From: jeon Date: Wed, 18 Sep 2019 07:22:11 +0000 (+0900) Subject: PUI_ani: free alloacted memory for event which is not added X-Git-Tag: accepted/tizen/5.5/unified/20200102.014046~9 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Flibpui.git;a=commitdiff_plain;h=960d4d184453a945082214238ba77c990da355a9 PUI_ani: free alloacted memory for event which is not added Change-Id: I788070dffba48065c2ed213a62d40ad8ca3dcc5f --- 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); } }