mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
gdk: Fix stage removal from the master clock
Prevents a double-free in the conformance test suite.
This commit is contained in:
parent
83edd9c4c5
commit
505801cd09
@ -304,14 +304,20 @@ clutter_master_clock_gdk_remove_stage_clock (ClutterMasterClockGdk *master_clock
|
|||||||
stages = g_hash_table_lookup (master_clock->clock_to_stage, frame_clock);
|
stages = g_hash_table_lookup (master_clock->clock_to_stage, frame_clock);
|
||||||
if (stages != NULL)
|
if (stages != NULL)
|
||||||
{
|
{
|
||||||
stages = g_list_remove (stages, stage);
|
if (stages->next == NULL)
|
||||||
if (stages == NULL)
|
|
||||||
{
|
{
|
||||||
g_signal_handlers_disconnect_by_func (frame_clock,
|
g_signal_handlers_disconnect_by_func (frame_clock,
|
||||||
clutter_master_clock_gdk_update,
|
clutter_master_clock_gdk_update,
|
||||||
master_clock);
|
master_clock);
|
||||||
g_hash_table_remove (master_clock->clock_to_stage, frame_clock);
|
g_hash_table_remove (master_clock->clock_to_stage, frame_clock);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stages = g_list_remove (stages, stage);
|
||||||
|
g_hash_table_replace (master_clock->clock_to_stage,
|
||||||
|
g_object_ref (frame_clock),
|
||||||
|
stages);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user