From: Jim Evins Date: Fri, 28 Nov 2003 05:10:26 +0000 (+0000) Subject: gl_view_delete_selection(): Actually clear out selection before deleting these objects. X-Git-Tag: glabels-2_3_0~536 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=115198aeead93ef3ef97cd081f5b855622403e0a;p=glabels gl_view_delete_selection(): Actually clear out selection before deleting these objects. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@357 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/src/view.c b/glabels2/src/view.c index b05e7ca1..35bfc183 100644 --- a/glabels2/src/view.c +++ b/glabels2/src/view.c @@ -2004,19 +2004,22 @@ gl_view_is_selection_atomic (glView *view) void gl_view_delete_selection (glView *view) { - GList *p, *p_next; + GList *object_list, *p, *p_next; gl_debug (DEBUG_VIEW, "START"); g_return_if_fail (view && GL_IS_VIEW (view)); - for (p = view->selected_object_list; p != NULL; p = p_next) { + object_list = view->selected_object_list; + view->selected_object_list = NULL; + g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); + + for (p = object_list; p != NULL; p = p_next) { p_next = p->next; g_object_unref (G_OBJECT (p->data)); + object_list = g_list_delete_link (object_list, p); } - g_signal_emit (G_OBJECT(view), signals[SELECTION_CHANGED], 0); - gl_debug (DEBUG_VIEW, "END"); }