[cairo-commit] goocanvas/demo widgets-demo.c,1.3,1.4

Damon Chaplin commit at pdx.freedesktop.org
Fri May 9 03:12:13 PDT 2008


Committed by: damon

Update of /cvs/cairo/goocanvas/demo
In directory kemper:/tmp/cvs-serv32032/demo

Modified Files:
	widgets-demo.c 
Log Message:
2008-05-09  Damon Chaplin  <damon at gnome.org>

	    * demo/widgets-demo.c (remove_widget_clicked): use g_list_delete_link
	    to update the GList, to avoid a crash.



Index: widgets-demo.c
===================================================================
RCS file: /cvs/cairo/goocanvas/demo/widgets-demo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- widgets-demo.c	8 Mar 2007 13:58:45 -0000	1.3
+++ widgets-demo.c	9 May 2008 10:12:11 -0000	1.4
@@ -33,7 +33,6 @@
 remove_widget_clicked (GtkWidget *button, gpointer data)
 {
   GooCanvasItem *witem;
-  GList *elem;
 
   if (!added_widget_items)
     return;
@@ -42,10 +41,9 @@
 
   goo_canvas_item_remove (witem);
 
-  elem = added_widget_items;
-  added_widget_items = added_widget_items->next;
-  g_list_free1 (elem);
-				
+  added_widget_items = g_list_delete_link (added_widget_items,
+					   added_widget_items);
+
   num_added_widgets--;
 }
 



More information about the cairo-commit mailing list