[mutter/gnome-3-36] clutter: Do not use stack-allocated ClutterEvents
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-36] clutter: Do not use stack-allocated ClutterEvents
- Date: Wed, 7 Oct 2020 17:55:22 +0000 (UTC)
commit 1bb1440586aa756b03863ea990e8d282149bcb6b
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Sep 24 17:21:18 2020 +0200
clutter: Do not use stack-allocated ClutterEvents
Use ClutterEvent* and clutter_event_new() to always allocate events.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1460
(cherry picked from commit 66640446796f148f4b92bb3194a8938aa456cd53)
clutter/clutter/clutter-stage.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index ba2f2440a9..9723ce49e7 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -4238,7 +4238,7 @@ _clutter_stage_update_state (ClutterStage *stage,
ClutterStageState set_flags)
{
ClutterStageState new_state;
- ClutterEvent event;
+ ClutterEvent *event;
new_state = stage->priv->current_state;
new_state |= set_flags;
@@ -4247,16 +4247,16 @@ _clutter_stage_update_state (ClutterStage *stage,
if (new_state == stage->priv->current_state)
return FALSE;
- memset (&event, 0, sizeof (event));
- event.type = CLUTTER_STAGE_STATE;
- clutter_event_set_stage (&event, stage);
+ event = clutter_event_new (CLUTTER_STAGE_STATE);
+ clutter_event_set_stage (event, stage);
- event.stage_state.new_state = new_state;
- event.stage_state.changed_mask = new_state ^ stage->priv->current_state;
+ event->stage_state.new_state = new_state;
+ event->stage_state.changed_mask = new_state ^ stage->priv->current_state;
stage->priv->current_state = new_state;
- clutter_stage_event (stage, &event);
+ clutter_stage_event (stage, event);
+ clutter_event_free (event);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]