[gtksourceview] Add a weak pointer to text buffer in gutter renderer.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Add a weak pointer to text buffer in gutter renderer.
- Date: Mon, 20 Dec 2010 21:28:03 +0000 (UTC)
commit 862cfffff9de001aa854c0915007909a453ae7d7
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Mon Dec 20 07:03:43 2010 +0100
Add a weak pointer to text buffer in gutter renderer.
gtksourceview/gtksourcegutterrenderer.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcegutterrenderer.c b/gtksourceview/gtksourcegutterrenderer.c
index 1dee8ab..31bc591 100644
--- a/gtksourceview/gtksourcegutterrenderer.c
+++ b/gtksourceview/gtksourcegutterrenderer.c
@@ -93,13 +93,18 @@ on_buffer_changed (GtkTextView *view,
GParamSpec *spec,
GtkSourceGutterRenderer *renderer)
{
+ GtkTextBuffer* 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 = gtk_text_view_get_buffer (view);
+ buffer = gtk_text_view_get_buffer (view);
+
+ renderer->priv->buffer = buffer;
+ g_object_add_weak_pointer (G_OBJECT (buffer), (gpointer)&renderer->priv->buffer);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]