From c682ad48f57e9316b809a64f70514ed68f711ed5 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sun, 9 Nov 2003 15:34:08 +0000 Subject: [PATCH] One of the signal handlers (view_scale_changed_cb) created with a view_highlight actually belongs to view. So when a view_highlight is finalized, we must disconnect this handler. This fixes the crash reported in bug #836873. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@336 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/src/view-highlight.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/glabels2/src/view-highlight.c b/glabels2/src/view-highlight.c index 5274656b..df8a501c 100644 --- a/glabels2/src/view-highlight.c +++ b/glabels2/src/view-highlight.c @@ -202,14 +202,21 @@ gl_view_highlight_instance_init (glViewHighlight *view_highlight) static void gl_view_highlight_finalize (GObject *object) { - glLabel *parent; - glView *view; + glLabel *parent; + glViewHighlight *view_highlight; gl_debug (DEBUG_VIEW, "START"); g_return_if_fail (object && GL_IS_VIEW_HIGHLIGHT (object)); - gtk_object_destroy (GTK_OBJECT(GL_VIEW_HIGHLIGHT(object)->private->position_group)); + view_highlight = GL_VIEW_HIGHLIGHT (object); + + /* Free up handler owned by view. */ + g_signal_handlers_disconnect_by_func (G_OBJECT (view_highlight->private->view), + G_CALLBACK (view_scale_changed_cb), + object); + + gtk_object_destroy (GTK_OBJECT(view_highlight->private->position_group)); G_OBJECT_CLASS (parent_class)->finalize (object); -- 2.39.5