]> git.sur5r.net Git - glabels/commitdiff
gl_view_delete_selection(): Actually clear out selection before deleting these objects.
authorJim Evins <evins@snaught.com>
Fri, 28 Nov 2003 05:10:26 +0000 (05:10 +0000)
committerJim Evins <evins@snaught.com>
Fri, 28 Nov 2003 05:10:26 +0000 (05:10 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@357 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/view.c

index b05e7ca1a78c24c6b8c00caf2676713dd28bef41..35bfc1839ae31b937ce742c98145e7a999e3fc93 100644 (file)
@@ -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");
 }