renderer/native: Steal the power save flip list before iterating over it
Because a single iteration might also grow the list again. Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
parent
19ffbaaa2a
commit
e5374ba456
1 changed files with 8 additions and 2 deletions
|
@ -731,12 +731,18 @@ static gboolean
|
|||
dummy_power_save_page_flip_cb (gpointer user_data)
|
||||
{
|
||||
MetaRendererNative *renderer_native = user_data;
|
||||
GList *old_list =
|
||||
g_steal_pointer (&renderer_native->power_save_page_flip_onscreens);
|
||||
|
||||
g_list_foreach (renderer_native->power_save_page_flip_onscreens,
|
||||
g_list_foreach (old_list,
|
||||
(GFunc) meta_onscreen_native_dummy_power_save_page_flip,
|
||||
NULL);
|
||||
g_clear_list (&renderer_native->power_save_page_flip_onscreens,
|
||||
g_clear_list (&old_list,
|
||||
g_object_unref);
|
||||
|
||||
if (renderer_native->power_save_page_flip_onscreens != NULL)
|
||||
return G_SOURCE_CONTINUE;
|
||||
|
||||
renderer_native->power_save_page_flip_source_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
|
|
Loading…
Reference in a new issue