[gnome-builder/editor-layout] no need to hold on to binding, it is destroyed automatically



commit e34d98ea351db9f4a12407522483d697a9150bf3
Author: Christian Hergert <christian hergert me>
Date:   Sat Nov 29 14:03:50 2014 -0800

    no need to hold on to binding, it is destroyed automatically

 src/editor/gb-editor-document.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/editor/gb-editor-document.c b/src/editor/gb-editor-document.c
index 70f3d48..c74d422 100644
--- a/src/editor/gb-editor-document.c
+++ b/src/editor/gb-editor-document.c
@@ -27,7 +27,6 @@
 struct _GbEditorDocumentPrivate
 {
   GtkSourceFile         *file;
-  GBinding              *file_binding;
   GbSourceChangeMonitor *change_monitor;
   GbSourceCodeAssistant *code_assistant;
 };
@@ -94,15 +93,13 @@ gb_editor_document_set_file (GbEditorDocument *document,
   if (file != priv->file)
     {
       g_clear_object (&priv->file);
-      g_clear_object (&priv->file_binding);
 
       if (file)
         {
           priv->file = g_object_ref (file);
-          priv->file_binding =
-            g_object_bind_property (priv->file, "location",
-                                    priv->change_monitor, "file",
-                                    G_BINDING_SYNC_CREATE);
+          g_object_bind_property (priv->file, "location",
+                                  priv->change_monitor, "file",
+                                  G_BINDING_SYNC_CREATE);
         }
 
       g_object_notify_by_pspec (G_OBJECT (document), gParamSpecs [PROP_FILE]);
@@ -154,7 +151,6 @@ gb_editor_document_finalize (GObject *object)
   ENTRY;
 
   g_clear_object (&priv->file);
-  g_clear_object (&priv->file_binding);
   g_clear_object (&priv->change_monitor);
   g_clear_object (&priv->code_assistant);
 


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