mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 02:50:41 -05:00
clutter/action: Take a ref on actions during event handling
ClutterStage will unref an action in the middle of its own event handler in case the action causes its own actor to be destroyed. In this case the action would get freed underneath our feet. To avoid it, take a ref on the action while calling its handle_event() vfunc, just as we do in clutter_actor_event() while emitting an event to an actor. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2389>
This commit is contained in:
parent
a1381ea6bc
commit
05cb4a4443
@ -99,7 +99,13 @@ gboolean
|
||||
clutter_action_handle_event (ClutterAction *action,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
return CLUTTER_ACTION_GET_CLASS (action)->handle_event (action, event);
|
||||
gboolean retval;
|
||||
|
||||
g_object_ref (action);
|
||||
retval = CLUTTER_ACTION_GET_CLASS (action)->handle_event (action, event);
|
||||
g_object_unref (action);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user