[gnome-builder] layout: take an extra ref during removal



commit ce952ec46978ca070b7657cd48be1ace82a23409
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 16 16:46:44 2016 +0300

    layout: take an extra ref during removal
    
    We need to be a bit safer when doing all this cleanup.

 libide/ide-layout-stack.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-layout-stack.c b/libide/ide-layout-stack.c
index 8c46988..4a99b04 100644
--- a/libide/ide-layout-stack.c
+++ b/libide/ide-layout-stack.c
@@ -86,6 +86,8 @@ ide_layout_stack_remove (IdeLayoutStack *self,
   g_return_if_fail (IDE_IS_LAYOUT_STACK (self));
   g_return_if_fail (IDE_IS_LAYOUT_VIEW (view));
 
+  g_object_ref (view);
+
   focus_after_close = g_list_nth_data (self->focus_history, 1);
   if (focus_after_close != NULL)
     g_object_ref (focus_after_close);
@@ -108,6 +110,8 @@ ide_layout_stack_remove (IdeLayoutStack *self,
 
       g_signal_emit (self, signals [EMPTY], 0);
     }
+
+  g_object_unref (view);
 }
 
 static void


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