plugins/default: Use local vars for refs
Since the completion callback (on_switch_workspace_effect_complete) sets priv->tml_switch_workspace1 to NULL, the unref was trying to unref NULL, and the reffed ClutterTimeline was not getting unreffed. This could be triggered by rapidly switching workspaces, switching again before the animation of the initial switch was done. Found while working on #2038. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2120>
This commit is contained in:
parent
d5f2ec6f1e
commit
7bb0055acd
@ -897,17 +897,20 @@ finish_timeline (ClutterTimeline *timeline)
|
||||
}
|
||||
|
||||
static void
|
||||
kill_switch_workspace (MetaPlugin *plugin)
|
||||
kill_switch_workspace (MetaPlugin *plugin)
|
||||
{
|
||||
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||
|
||||
if (priv->tml_switch_workspace1)
|
||||
{
|
||||
g_object_ref (priv->tml_switch_workspace1);
|
||||
clutter_timeline_stop (priv->tml_switch_workspace1);
|
||||
clutter_timeline_stop (priv->tml_switch_workspace2);
|
||||
g_signal_emit_by_name (priv->tml_switch_workspace1, "completed", NULL);
|
||||
g_object_unref (priv->tml_switch_workspace1);
|
||||
g_autoptr (ClutterTimeline) timeline1 = NULL;
|
||||
g_autoptr (ClutterTimeline) timeline2 = NULL;
|
||||
|
||||
timeline1 = g_object_ref (priv->tml_switch_workspace1);
|
||||
timeline2 = g_object_ref (priv->tml_switch_workspace2);
|
||||
|
||||
finish_timeline (timeline1);
|
||||
finish_timeline (timeline2);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user