[gnome-builder] code: fix object destruction check



commit 11e04c8a1917fe8864f2cd919095553b951ef71d
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jan 27 12:34:32 2019 -0800

    code: fix object destruction check

 src/libide/code/ide-buffer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/code/ide-buffer.c b/src/libide/code/ide-buffer.c
index 55838b431..8e22b792d 100644
--- a/src/libide/code/ide-buffer.c
+++ b/src/libide/code/ide-buffer.c
@@ -2630,7 +2630,9 @@ ide_buffer_dup_content (IdeBuffer *self)
        */
       self->content = g_bytes_new_take (g_steal_pointer (&text), len);
 
-      if (!ide_object_in_destruction (IDE_OBJECT (self)))
+      /* Only persist if we have access to the object tree */
+      if (self->buffer_manager != NULL &&
+          !ide_object_in_destruction (IDE_OBJECT (self->buffer_manager)))
         {
           file = ide_buffer_get_file (self);
           context = ide_buffer_ref_context (IDE_BUFFER (self));


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