diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-08-29 09:26:15 -0400 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-08-29 17:17:08 +0200 |
commit | 9e0a285eea9753ed8f6999c1813d43724faf0c31 (patch) | |
tree | 6bc9977f44e6c9940bc887efb20ccfe4c9d8c01f /src/lib/emotion/emotion_smart.c | |
parent | 0ef9228e5ff0b5b506ebb95136998463d6d0091c (diff) |
efl: implement efl.file::unload for classes that implement load
unload is a crucial method for classes that implement load, as this is
the method which is called during e.g., efl_file_simple_load() when
a new file is specified in order to destroy the previous object data
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9786
Diffstat (limited to '')
-rw-r--r-- | src/lib/emotion/emotion_smart.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index d733e41029..a7a8fa8905 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c | |||
@@ -366,6 +366,22 @@ _efl_canvas_video_efl_file_loaded_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vide | |||
366 | return sd->open && sd->loaded; | 366 | return sd->open && sd->loaded; |
367 | } | 367 | } |
368 | 368 | ||
369 | EOLIAN static void | ||
370 | _efl_canvas_video_efl_file_unload(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) | ||
371 | { | ||
372 | if (sd->engine_instance) emotion_engine_instance_file_close(sd->engine_instance); | ||
373 | sd->engine_instance = NULL; | ||
374 | evas_object_image_data_set(sd->obj, NULL); | ||
375 | evas_object_image_size_set(sd->obj, 1, 1); | ||
376 | _emotion_image_data_zero(sd->obj); | ||
377 | |||
378 | if (sd->anim) ecore_animator_del(sd->anim); | ||
379 | sd->anim = NULL; | ||
380 | |||
381 | _xattr_data_cancel(sd->xattr); | ||
382 | sd->loaded = 0; | ||
383 | } | ||
384 | |||
369 | EOLIAN static Eina_Error | 385 | EOLIAN static Eina_Error |
370 | _efl_canvas_video_efl_file_load(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) | 386 | _efl_canvas_video_efl_file_load(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) |
371 | { | 387 | { |
@@ -410,7 +426,6 @@ _efl_canvas_video_efl_file_load(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) | |||
410 | evas_object_image_data_set(sd->obj, NULL); | 426 | evas_object_image_data_set(sd->obj, NULL); |
411 | evas_object_image_size_set(sd->obj, 1, 1); | 427 | evas_object_image_size_set(sd->obj, 1, 1); |
412 | _emotion_image_data_zero(sd->obj); | 428 | _emotion_image_data_zero(sd->obj); |
413 | eina_stringshare_replace(&sd->file, NULL); | ||
414 | } | 429 | } |
415 | 430 | ||
416 | if (sd->anim) ecore_animator_del(sd->anim); | 431 | if (sd->anim) ecore_animator_del(sd->anim); |