[gnome-shell] Disconnect from window signal handlers when removing a window



commit 81d579aca07fc6c24bf61d45d498321fc4c0ac82
Author: Colin Walters <walters verbum org>
Date:   Tue Oct 20 17:43:51 2009 -0400

    Disconnect from window signal handlers when removing a window
    
    We need to remove all of our signal handlers attached to a window
    when being disposed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=598502

 src/shell-app.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index ac0cf56..e89fcbe 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -324,8 +324,11 @@ void
 _shell_app_remove_window (ShellApp   *app,
                           MetaWindow *window)
 {
+  g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_unmanaged), app);
+  g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_user_time_changed), app);
   g_object_unref (window);
   app->windows = g_slist_remove (app->windows, window);
+
   if (app->windows == NULL)
     disconnect_workspace_switch (app);
 }
@@ -346,12 +349,8 @@ shell_app_dispose (GObject *object)
       app->info = NULL;
     }
 
-  if (app->windows)
-    {
-      g_slist_foreach (app->windows, (GFunc) g_object_unref, NULL);
-      g_slist_free (app->windows);
-      app->windows = NULL;
-    }
+  while (app->windows)
+    _shell_app_remove_window (app, app->windows->data);
 
   disconnect_workspace_switch (app);
 }



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