[gnome-builder] buffers: fix counter tracking



commit 312ee25c362dd339eb2036b84c205d1abdc56aaf
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jun 18 02:14:47 2017 -0700

    buffers: fix counter tracking

 libide/buffers/ide-buffer-manager.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libide/buffers/ide-buffer-manager.c b/libide/buffers/ide-buffer-manager.c
index f9e67c6..af24bb3 100644
--- a/libide/buffers/ide-buffer-manager.c
+++ b/libide/buffers/ide-buffer-manager.c
@@ -400,8 +400,6 @@ ide_buffer_manager_track_buffer (IdeBufferManager *self,
                            self,
                            (G_CONNECT_SWAPPED | G_CONNECT_AFTER));
 
-  DZL_COUNTER_INC (registered);
-
   g_list_model_items_changed (G_LIST_MODEL (self), self->buffers->len - 1, 0, 1);
 
   IDE_EXIT;
@@ -534,7 +532,10 @@ ide_buffer_manager_load_file__load_cb (GObject      *object,
    * properly when teh buffer is disposed.
    */
   if (state->is_new)
-    g_ptr_array_add (self->buffers, g_object_ref (state->buffer));
+    {
+      g_ptr_array_add (self->buffers, g_object_ref (state->buffer));
+      DZL_COUNTER_INC (registered);
+    }
 
   if (!gtk_source_file_loader_load_finish (loader, result, &error))
     {
@@ -1840,6 +1841,7 @@ ide_buffer_manager_create_temporary_buffer (IdeBufferManager *self)
   g_signal_emit (self, signals [LOAD_BUFFER], 0, buffer, TRUE);
 
   g_ptr_array_add (self->buffers, g_object_ref (buffer));
+  DZL_COUNTER_INC (registered);
   ide_buffer_manager_track_buffer (self, buffer);
 
   g_signal_emit (self, signals [BUFFER_LOADED], 0, buffer);


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