summaryrefslogtreecommitdiff
path: root/src/tests/emotion
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-11-27 01:39:40 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-11-27 01:48:37 +0900
commit106960af59174657c5f8315166169bb15d37d175 (patch)
tree86a7623af1df640bf9f6757ed5930b233b7bfe41 /src/tests/emotion
parent662d086837d681fa35100a3c0d9a9d0d608c1927 (diff)
emotion emotion_test: free allocated data when the dependent object is
deleted. This fixes coverity CID 1099709.
Diffstat (limited to 'src/tests/emotion')
-rw-r--r--src/tests/emotion/emotion_test_main.c8
1 files changed, 8 insertions, 0 deletions
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
@@ -331,6 +331,13 @@ bg_key_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U
331} 331}
332 332
333static void 333static void
334_oe_free_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
335 void *event_info EINA_UNUSED)
336{
337 free(data);
338}
339
340static void
334video_obj_time_changed(Evas_Object *obj, Evas_Object *edje) 341video_obj_time_changed(Evas_Object *obj, Evas_Object *edje)
335{ 342{
336 double pos, len, scale; 343 double pos, len, scale;
@@ -618,6 +625,7 @@ init_video_object(const char *module_filename, const char *filename)
618 fd = calloc(1, sizeof(Frame_Data)); 625 fd = calloc(1, sizeof(Frame_Data));
619 626
620 oe = edje_object_add(evas); 627 oe = edje_object_add(evas);
628 evas_object_event_callback_add(oe, EVAS_CALLBACK_FREE, _oe_free_cb, NULL);
621 evas_object_data_set(oe, "frame_data", fd); 629 evas_object_data_set(oe, "frame_data", fd);
622 if (reflex) 630 if (reflex)
623 edje_object_file_set(oe, theme_get(), "video_controller/reflex"); 631 edje_object_file_set(oe, theme_get(), "video_controller/reflex");