3 Reason: fix crash/infinite loop in the Skein
5 --- gnome-inform7-5T18/src/inspector.c 2008/01/21 00:01:28 1.14
6 +++ gnome-inform7-5T18/src/inspector.c 2008/05/11 18:57:22 1.15
8 void refresh_inspector(Story *thestory) {
10 /* Erase the previous story's Skein canvas */
11 - if(thestory->skeingroup[SKEIN_INSPECTOR]) {
12 - gtk_object_destroy(GTK_OBJECT(thestory->skeingroup[SKEIN_INSPECTOR]));
13 - thestory->skeingroup[SKEIN_INSPECTOR] = NULL;
15 + GtkWidget *canvas = lookup_widget(inspector_window,
16 + "skein_inspector_canvas");
17 + clear_gnome_canvas_impolitely(GNOME_CANVAS(canvas));
18 #endif /* I_LIKE_SKEIN */
20 /* Set the story we are currently inspecting */
21 --- gnome-inform7-5T18/src/tabskein.c 2008/01/21 00:01:28 1.6
22 +++ gnome-inform7-5T18/src/tabskein.c 2008/05/11 18:57:23 1.7
27 +destroy_gnome_canvas_item(gpointer item, gpointer data)
30 + gtk_object_destroy(GTK_OBJECT(item));
33 +/* Clear a GnomeCanvas by iterating over its private item_list member. This
34 +should probably not be done, but there's no other way to do it, so, well, there
37 +clear_gnome_canvas_impolitely(GnomeCanvas *canvas)
39 + g_return_if_fail(canvas);
40 + GnomeCanvasGroup *rootgroup = gnome_canvas_root(canvas);
41 + g_list_foreach(rootgroup->item_list, destroy_gnome_canvas_item, NULL);
42 + g_list_free(rootgroup->item_list);
43 + rootgroup->item_list = rootgroup->item_list_end = NULL;
47 clicked_node_free(gpointer data, GClosure *closure)
53 /* Create a new canvas group for the skein */
54 - /* This is the polite way, but there should just be a way to do it given
56 - if(thestory->skeingroup[foo])
57 - gtk_object_destroy(GTK_OBJECT(thestory->skeingroup[foo]));
60 - GnomeCanvasGroup *rootgroup = gnome_canvas_root(canvas);
62 - for(iter = rootgroup->item_list; iter; iter = iter->next)
63 - gtk_object_destroy(GTK_OBJECT(iter->data));
64 - g_list_free(rootgroup->item_list);
65 - rootgroup->item_list = NULL;
66 + clear_gnome_canvas_impolitely(canvas);
68 thestory->skeingroup[foo] = GNOME_CANVAS_GROUP(
69 gnome_canvas_item_new(gnome_canvas_root(canvas),
70 --- gnome-inform7-5T18/src/tabskein.h 2008/01/21 00:01:28 1.5
71 +++ gnome-inform7-5T18/src/tabskein.h 2008/05/11 18:57:23 1.6
76 +void clear_gnome_canvas_impolitely(GnomeCanvas *canvas);
77 gboolean draw_node(GNode *node, Story *thestory);
78 void skein_layout_and_redraw(Skein *skein, Story *thestory);
79 void skein_schedule_redraw(Skein *skein, Story *thestory);