--- app/diagram.c.orig	2006-04-27 16:44:03.000000000 +0200
+++ app/diagram.c	2006-05-02 10:39:54.000000000 +0200
@@ -1139,7 +1139,7 @@
   DiaObject *group;
   GList *group_list;
 /*   GList *list; */
-  GList *selected;
+  GList *selected, *selection_copy;
   int group_index;
   int any_groups = 0;
   
@@ -1148,7 +1148,8 @@
     return;
   }
   
-  selected = dia->data->selected;
+  selection_copy = g_list_copy(dia->data->selected);
+  selected = selection_copy;
   while (selected != NULL) {
     group = (DiaObject *)selected->data;
 
@@ -1188,6 +1189,7 @@
     }
     selected = g_list_next(selected);
   }
+  g_list_free(selection_copy);
   
   if (any_groups) {
     diagram_modified(dia);
