[gnome-builder] editor: use g_signal_connect_object() to disconnect after destroy



commit e978f45aa55095cfe5cefa7899faf75588cbe66a
Author: Christian Hergert <christian hergert me>
Date:   Sun Oct 12 20:17:33 2014 -0400

    editor: use g_signal_connect_object() to disconnect after destroy
    
    Handy so we don't have to manually disconnect things during destroy.

 src/editor/gb-editor-tab.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/editor/gb-editor-tab.c b/src/editor/gb-editor-tab.c
index cdf0909..df5fbcf 100644
--- a/src/editor/gb-editor-tab.c
+++ b/src/editor/gb-editor-tab.c
@@ -1246,10 +1246,11 @@ gb_editor_tab_constructed (GObject *object)
                             G_CALLBACK (gb_editor_tab_move_previous_match),
                             tab);
 
-  g_signal_connect_swapped (priv->search_context,
-                            "notify::occurrences-count",
-                            G_CALLBACK (on_search_occurrences_notify),
-                            tab);
+  g_signal_connect_object (priv->search_context,
+                           "notify::occurrences-count",
+                           G_CALLBACK (on_search_occurrences_notify),
+                           tab,
+                           G_CONNECT_SWAPPED);
 
   gtk_source_completion_words_register (
       GTK_SOURCE_COMPLETION_WORDS (priv->words_provider),


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