[vte] app: Disconnect signal handlers on dispose



commit c735479b7542b938bfb9709860fff58c5ca9fe6f
Author: Christian Persch <chpe src gnome org>
Date:   Wed Sep 21 22:13:53 2022 +0200

    app: Disconnect signal handlers on dispose
    
    Fixes two critical warnings when closing a window with the close button.

 src/app/app.cc | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/app/app.cc b/src/app/app.cc
index 1b849d41..9809af61 100644
--- a/src/app/app.cc
+++ b/src/app/app.cc
@@ -2753,6 +2753,15 @@ vteapp_window_dispose(GObject *object)
                 window->search_popover = nullptr;
         }
 
+        // Disconnect all signal handlers from the terminal
+        g_signal_handlers_disconnect_matched(window->terminal,
+                                             GSignalMatchType(G_SIGNAL_MATCH_DATA),
+                                             0, // signal id
+                                             0, // detail quark
+                                             nullptr, // closure
+                                             nullptr, // func
+                                             window);
+
         G_OBJECT_CLASS(vteapp_window_parent_class)->dispose(object);
 }
 


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