[libwnck/wip/muktupavels/issue-141] window: remove window from class group in finalize



commit be8cbe495a87b2113f52ad19300a96121d0cb0ee
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Aug 2 14:53:11 2019 +0300

    window: remove window from class group in finalize
    
    Windows can be destroyed using wnck_shutdown. In that case nothing
    removes window from class group. If class group is shared between
    multiple windows we end up with obsolete/invalid signal handlers.
    
    Remove window from class group in finalize to make sure that signal
    handlers are removed/disconnected before window is destroyed.
    
    https://gitlab.gnome.org/GNOME/libwnck/issues/141

 libwnck/window.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libwnck/window.c b/libwnck/window.c
index 315bf67..8010743 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -410,8 +410,12 @@ wnck_window_finalize (GObject *object)
   window->priv->app = NULL;
 
   if (window->priv->class_group)
-    g_object_unref (G_OBJECT (window->priv->class_group));
-  window->priv->class_group = NULL;
+    {
+      _wnck_class_group_remove_window (window->priv->class_group, window);
+
+      g_object_unref (G_OBJECT (window->priv->class_group));
+      window->priv->class_group = NULL;
+    }
 
   g_free (window->priv->name);
   window->priv->name = NULL;


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