[gnome-builder/gnome-builder-3-20] source-view: keep a reference to word start and end marks



commit 346912a3f873169c7eb226ffc4b7a4b42a248958
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 5 09:39:35 2016 +0300

    source-view: keep a reference to word start and end marks
    
    These are borrowed references when creating, we need to have our own
    reference to them during the lifecycle of the asynchronous callback.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765993

 libide/ide-source-view.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index f8c94b2..5e1f6ad 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -2760,12 +2760,16 @@ ide_source_view_real_motion_notify_event (GtkWidget      *widget,
     }
 
   data = g_slice_new0 (DefinitionHighlightData);
-  data->self = g_object_ref (self);
+  data->self = self;
   data->word_start_mark = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (priv->buffer),
                                                        NULL, &start_iter, TRUE);
   data->word_end_mark = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (priv->buffer),
                                                      NULL, &end_iter, TRUE);
 
+  g_object_ref (data->self);
+  g_object_ref (data->word_start_mark);
+  g_object_ref (data->word_end_mark);
+
   ide_buffer_get_symbol_at_location_async (priv->buffer,
                                            &iter,
                                            NULL,


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