From 106960af59174657c5f8315166169bb15d37d175 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Wed, 27 Nov 2013 01:39:40 +0900 Subject: [PATCH] emotion emotion_test: free allocated data when the dependent object is deleted. This fixes coverity CID 1099709. --- src/tests/emotion/emotion_test_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c index f1b4fed8ba..7fe801e0f2 100644 --- a/src/tests/emotion/emotion_test_main.c +++ b/src/tests/emotion/emotion_test_main.c @@ -330,6 +330,13 @@ bg_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U } } +static void +_oe_free_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + free(data); +} + static void video_obj_time_changed(Evas_Object *obj, Evas_Object *edje) { @@ -618,6 +625,7 @@ init_video_object(const char *module_filename, const char *filename) fd = calloc(1, sizeof(Frame_Data)); oe = edje_object_add(evas); + evas_object_event_callback_add(oe, EVAS_CALLBACK_FREE, _oe_free_cb, NULL); evas_object_data_set(oe, "frame_data", fd); if (reflex) edje_object_file_set(oe, theme_get(), "video_controller/reflex");