[gnome-settings-daemon/wip/benzea/cleanups-and-small-fixes: 1/18] media-keys: Unconditionally clean proxy pointers



commit f0ce7a658bb7dc5dabecbbf8279b8eacc5af36b8
Author: Benjamin Berg <bberg redhat com>
Date:   Wed Feb 6 18:05:44 2019 +0100

    media-keys: Unconditionally clean proxy pointers
    
    This has no function change, it just means that we explicitly clean the
    pointers again when the new name appears on the bus.

 plugins/media-keys/gsd-media-keys-manager.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 1576b61c..f8c87762 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2882,6 +2882,10 @@ shell_presence_changed (GsdMediaKeysManager *manager)
 
         name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (manager->priv->shell_proxy));
 
+        g_ptr_array_set_size (manager->priv->keys, 0);
+        g_clear_object (&manager->priv->key_grabber);
+        g_clear_object (&manager->priv->screencast_proxy);
+
         if (name_owner) {
                 shell_key_grabber_proxy_new_for_bus (G_BUS_TYPE_SESSION,
                                                      0,
@@ -2898,10 +2902,6 @@ shell_presence_changed (GsdMediaKeysManager *manager)
                                           manager->priv->screencast_cancellable,
                                           on_screencast_proxy_ready, manager);
                 g_free (name_owner);
-        } else {
-                g_ptr_array_set_size (manager->priv->keys, 0);
-                g_clear_object (&manager->priv->key_grabber);
-                g_clear_object (&manager->priv->screencast_proxy);
         }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]