[gtksourceview] Prevent construction of completion after dispose has run



commit 89382601e772c0504ae7e5f709399f4dd3b0d291
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Mon Dec 20 00:03:50 2010 +0100

    Prevent construction of completion after dispose has run

 gtksourceview/gtksourceview.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 8bf8d59..3287229 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -161,6 +161,7 @@ struct _GtkSourceViewPrivate
 	gint             num_line_digits;
 
 	guint            current_line_color_set : 1;
+	guint            dispose_has_run : 1;
 };
 
 
@@ -1057,6 +1058,8 @@ gtk_source_view_dispose (GObject *object)
 		view->priv->right_gutter = NULL;
 	}
 
+	view->priv->dispose_has_run = 1;
+
 	G_OBJECT_CLASS (gtk_source_view_parent_class)->dispose (object);
 }
 
@@ -4153,7 +4156,7 @@ gtk_source_view_get_completion (GtkSourceView *view)
 {
 	g_return_val_if_fail (GTK_IS_SOURCE_VIEW (view), NULL);
 
-	if (view->priv->completion == NULL)
+	if (view->priv->completion == NULL && !view->priv->dispose_has_run)
 	{
 		view->priv->completion = gtk_source_completion_new (view);
 	}



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