diff options
author | Paolo Borelli <pborelli@gnome.org> | 2012-11-03 17:43:30 +0100 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2012-11-03 17:43:30 +0100 |
commit | 1302cc4161fd206b9b3fcb55ca29442ec00bdcf8 (patch) | |
tree | ffd86f590e454756e74e1c140252a53a67eb8363 /gtksourceview/gtksourcegutterrenderer.c | |
parent | 6acb3641d16c347a657460d9f7ec8fbb1c362269 (diff) | |
download | gtksourceview-1302cc4161fd206b9b3fcb55ca29442ec00bdcf8.tar.gz |
Do not keep weak pointer to the buffer
It is up to GtkTextView to not emit extra notifications if the buffer is
actually the same, so we do not need to keep a weak pointer just to
check whether the buffer is the same.
Diffstat (limited to 'gtksourceview/gtksourcegutterrenderer.c')
-rw-r--r-- | gtksourceview/gtksourcegutterrenderer.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/gtksourceview/gtksourcegutterrenderer.c b/gtksourceview/gtksourcegutterrenderer.c index e692f822..69ff56d4 100644 --- a/gtksourceview/gtksourcegutterrenderer.c +++ b/gtksourceview/gtksourcegutterrenderer.c @@ -41,7 +41,6 @@ enum struct _GtkSourceGutterRendererPrivate { GtkTextView *view; - GtkTextBuffer *buffer; GtkTextWindowType window_type; gint xpad; @@ -92,20 +91,13 @@ static void emit_buffer_changed (GtkTextView *view, GtkSourceGutterRenderer *renderer) { - GtkTextBuffer* buffer; + GtkTextBuffer *buffer; buffer = gtk_text_view_get_buffer (view); - if (buffer != renderer->priv->buffer) + if (GTK_SOURCE_GUTTER_RENDERER_GET_CLASS (renderer)->change_buffer) { - if (GTK_SOURCE_GUTTER_RENDERER_GET_CLASS (renderer)->change_buffer) - { - GTK_SOURCE_GUTTER_RENDERER_GET_CLASS (renderer)->change_buffer (renderer, - renderer->priv->buffer); - } - - renderer->priv->buffer = buffer; - g_object_add_weak_pointer (G_OBJECT (buffer), (gpointer)&renderer->priv->buffer); + GTK_SOURCE_GUTTER_RENDERER_GET_CLASS (renderer)->change_buffer (renderer, buffer); } } |