[gnome-builder] code: only update objects when context is accessible
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code: only update objects when context is accessible
- Date: Sun, 27 Jan 2019 20:03:17 +0000 (UTC)
commit 06068a50d2f731bb98af132d0e1afeb71d0295d6
Author: Christian Hergert <chergert redhat com>
Date: Sun Jan 27 12:01:51 2019 -0800
code: only update objects when context is accessible
Fixes #787
src/libide/code/ide-buffer.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/libide/code/ide-buffer.c b/src/libide/code/ide-buffer.c
index 9ae289ecf..55838b431 100644
--- a/src/libide/code/ide-buffer.c
+++ b/src/libide/code/ide-buffer.c
@@ -2630,10 +2630,13 @@ ide_buffer_dup_content (IdeBuffer *self)
*/
self->content = g_bytes_new_take (g_steal_pointer (&text), len);
- file = ide_buffer_get_file (self);
- context = ide_buffer_ref_context (IDE_BUFFER (self));
- unsaved_files = ide_unsaved_files_from_context (context);
- ide_unsaved_files_update (unsaved_files, file, self->content);
+ if (!ide_object_in_destruction (IDE_OBJECT (self)))
+ {
+ file = ide_buffer_get_file (self);
+ context = ide_buffer_ref_context (IDE_BUFFER (self));
+ unsaved_files = ide_unsaved_files_from_context (context);
+ ide_unsaved_files_update (unsaved_files, file, self->content);
+ }
}
return g_bytes_ref (self->content);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]