[epiphany/mcatanzaro/notebook-remove-signal] notebook: fix invalid signal handler warning



commit 31e45a392ae1ae2b20f37660e7f46626cdfa4ac9
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Sep 2 20:49:46 2019 -0500

    notebook: fix invalid signal handler warning
    
    This fixes this warning when closing tabs:
    
    GLib-GObject-WARNING **: 20:45:54.015: ../../../../Projects/glib/gobject/gsignal.c:2647: instance 
'0x1a463b0' has no handler with id '7129'
    
    It's caused because we accidentally disconnect a signal that's being
    managed by GtkNotebook.

 src/ephy-notebook.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index b75b6a860..8d76bfec3 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -865,14 +865,13 @@ ephy_notebook_remove (GtkContainer *container,
   position = gtk_notebook_page_num (gnotebook, tab_widget);
   curr = gtk_notebook_get_current_page (gnotebook);
 
-  if (position == curr) {
+  if (position == curr)
     smart_tab_switching_on_closure (notebook, tab_widget);
-  }
-
-  g_signal_handlers_disconnect_by_data (tab_widget, notebook);
 
   GTK_CONTAINER_CLASS (ephy_notebook_parent_class)->remove (container, tab_widget);
 
+  g_signal_handlers_disconnect_by_data (tab_widget, notebook);
+
   update_tabs_visibility (notebook, FALSE);
 }
 


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