From 960d4d184453a945082214238ba77c990da355a9 Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 18 Sep 2019 16:22:11 +0900 Subject: [PATCH] PUI_ani: free alloacted memory for event which is not added Change-Id: I788070dffba48065c2ed213a62d40ad8ca3dcc5f --- src/PUI_ani.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/PUI_ani.c b/src/PUI_ani.c index 28db340..325274e 100644 --- a/src/PUI_ani.c +++ b/src/PUI_ani.c @@ -296,18 +296,7 @@ pui_ani_status_update(pui_ani_t *ani, pui_ani_status status) ani_h = ani->ani_h; - e = (PUI_Event_Animation_Status *)calloc(1, sizeof(PUI_Event_Animation_Status)); - - if (!e) - { - pui_err("Failed to allocate memory for PUI Event !\n"); - return; - } - ani->status = status; - e->ani_h = ani_h; - e->win = ecore_wl2_window_id_get(ani_h->pui_handle->win); - e->status = status; switch (status) { @@ -337,6 +326,18 @@ pui_ani_status_update(pui_ani_t *ani, pui_ani_status status) if (ev_type > 0) { + e = (PUI_Event_Animation_Status *)calloc(1, sizeof(PUI_Event_Animation_Status)); + + if (!e) + { + pui_err("Failed to allocate memory for PUI Event !\n"); + return; + } + + e->ani_h = ani_h; + e->win = ecore_wl2_window_id_get(ani_h->pui_handle->win); + e->status = status; + ecore_event_add(ev_type, e, NULL, ani_h); } } -- 2.7.4