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



commit 113fecf26e5b2a8410d287abb8a9a41c439182f8
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 fd6a5eca..0847420c 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2885,6 +2885,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,
@@ -2901,10 +2905,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]