From 50868579a06377a23bea74409c5b15205c96ec08 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 25 Nov 2008 13:19:48 +0000 Subject: [PATCH] Bug 1299 - clutter_score_remove will segmentation fault if timelines are more than 52 and continue to remove them * clutter/clutter-score.c (traverse_children): Don't destroy the entry in the handler for REMOVE_BY_ID. It will be removed again anyway in the call to g_node_traverse. This was causing a crash. Thanks to zhangwei for spotting. --- ChangeLog | 10 ++++++++++ clutter/clutter-score.c | 21 ++++----------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b2e089..d6f1267 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-11-25 Neil Roberts + + Bug 1299 - clutter_score_remove will segmentation fault if + timelines are more than 52 and continue to remove them + + * clutter/clutter-score.c (traverse_children): Don't destroy the + entry in the handler for REMOVE_BY_ID. It will be removed again + anyway in the call to g_node_traverse. This was causing a + crash. Thanks to zhangwei for spotting. + 2008-11-24 Neil Roberts Add a wrapper library to help testing without NPOTs. diff --git a/clutter/clutter-score.c b/clutter/clutter-score.c index cb65b8b..cbb808a 100644 --- a/clutter/clutter-score.c +++ b/clutter/clutter-score.c @@ -505,30 +505,17 @@ traverse_children (GNode *node, case REMOVE_BY_ID: if (closure->d.id == entry->id) { - if (entry->complete_id) - { - g_signal_handler_disconnect (entry->timeline, entry->complete_id); - entry->complete_id = 0; - } - - if (entry->marker_id) - { - g_signal_handler_disconnect (entry->timeline, entry->marker_id); - entry->marker_id = 0; - } - - g_object_unref (entry->timeline); - + /* Destroy all the child entries of this node */ g_node_traverse (node, G_POST_ORDER, G_TRAVERSE_ALL, -1, destroy_entry, NULL); - g_free (entry->marker); - g_slice_free (ClutterScoreEntry, entry); - + /* Keep track of this node so that it will be destroyed + further up */ closure->result = node; + retval = TRUE; } break; -- 2.7.4