summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-07-03 01:58:13 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-07-03 01:58:13 +0000
commitebdc0f07a14074689b0941da3f9fe4fdb75abb41 (patch)
treef2107e499c6a16c453a878e6b4a74f4df7deb2a0 /legacy/emotion
parent10b93e5e1e18de865411bf56bd38e347e2e5cbd9 (diff)
emotion: add infra to properly track pending object on shutdown.
SVN revision: 73176
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/ChangeLog4
-rw-r--r--legacy/emotion/NEWS1
-rw-r--r--legacy/emotion/src/bin/emotion_test_main.c4
-rw-r--r--legacy/emotion/src/lib/emotion_main.c27
-rw-r--r--legacy/emotion/src/lib/emotion_private.h3
5 files changed, 39 insertions, 0 deletions
diff --git a/legacy/emotion/ChangeLog b/legacy/emotion/ChangeLog
index beb9c64034..ae4b10a2f8 100644
--- a/legacy/emotion/ChangeLog
+++ b/legacy/emotion/ChangeLog
@@ -25,3 +25,7 @@
252012-06-19 Cedric Bail 252012-06-19 Cedric Bail
26 26
27 * Sync rendering with Ecore_Animator. 27 * Sync rendering with Ecore_Animator.
28
292012-06-03 Cedric Bail
30
31 * Track pending object for proper shutdown.
diff --git a/legacy/emotion/NEWS b/legacy/emotion/NEWS
index cb4d5af68f..5fffba7213 100644
--- a/legacy/emotion/NEWS
+++ b/legacy/emotion/NEWS
@@ -7,6 +7,7 @@ Additions:
7 - Add support for "playback_started" callback to generic player. 7 - Add support for "playback_started" callback to generic player.
8 - Implement SPU switch for generic/vlc. 8 - Implement SPU switch for generic/vlc.
9 - Sync rendering with Ecore_Animator. 9 - Sync rendering with Ecore_Animator.
10 - Track pending object for proper shutdown.
10 11
11Fixes: 12Fixes:
12 - build out of tree. 13 - build out of tree.
diff --git a/legacy/emotion/src/bin/emotion_test_main.c b/legacy/emotion/src/bin/emotion_test_main.c
index 93c80fd432..80446ac66e 100644
--- a/legacy/emotion/src/bin/emotion_test_main.c
+++ b/legacy/emotion/src/bin/emotion_test_main.c
@@ -719,6 +719,8 @@ main(int argc, char **argv)
719 evas_font_cache_set(evas, 1 * 1024 * 1024); 719 evas_font_cache_set(evas, 1 * 1024 * 1024);
720 evas_font_path_append(evas, PACKAGE_DATA_DIR"/data/fonts"); 720 evas_font_path_append(evas, PACKAGE_DATA_DIR"/data/fonts");
721 721
722 emotion_init();
723
722 bg_setup(); 724 bg_setup();
723 725
724 for (; args < argc; args++) 726 for (; args < argc; args++)
@@ -729,6 +731,8 @@ main(int argc, char **argv)
729 ecore_main_loop_begin(); 731 ecore_main_loop_begin();
730 732
731 main_signal_exit(NULL, 0, NULL); 733 main_signal_exit(NULL, 0, NULL);
734
735 emotion_shutdown();
732 ecore_evas_free(ecore_evas); 736 ecore_evas_free(ecore_evas);
733 ecore_evas_shutdown(); 737 ecore_evas_shutdown();
734 edje_shutdown(); 738 edje_shutdown();
diff --git a/legacy/emotion/src/lib/emotion_main.c b/legacy/emotion/src/lib/emotion_main.c
index 74c6eebbd4..52b1baa597 100644
--- a/legacy/emotion/src/lib/emotion_main.c
+++ b/legacy/emotion/src/lib/emotion_main.c
@@ -49,6 +49,7 @@ void *alloca (size_t);
49#include "emotion_private.h" 49#include "emotion_private.h"
50 50
51static Emotion_Version _version = { VMAJ, VMIN, VMIC, VREV }; 51static Emotion_Version _version = { VMAJ, VMIN, VMIC, VREV };
52static int emotion_pending_objects = 0;
52EAPI Emotion_Version *emotion_version = &_version; 53EAPI Emotion_Version *emotion_version = &_version;
53 54
54EAPI int EMOTION_WEBCAM_UPDATE = 0; 55EAPI int EMOTION_WEBCAM_UPDATE = 0;
@@ -343,6 +344,8 @@ emotion_init(void)
343 344
344 if (_emotion_webcams_count++) return EINA_TRUE; 345 if (_emotion_webcams_count++) return EINA_TRUE;
345 346
347 ecore_init();
348
346 snprintf(buffer, 4096, "%s/emotion.cfg", PACKAGE_DATA_DIR); 349 snprintf(buffer, 4096, "%s/emotion.cfg", PACKAGE_DATA_DIR);
347 _emotion_webcams_file = eet_open(buffer, EET_FILE_MODE_READ); 350 _emotion_webcams_file = eet_open(buffer, EET_FILE_MODE_READ);
348 if (_emotion_webcams_file) 351 if (_emotion_webcams_file)
@@ -382,6 +385,7 @@ EAPI Eina_Bool
382emotion_shutdown(void) 385emotion_shutdown(void)
383{ 386{
384 Emotion_Webcam *ew; 387 Emotion_Webcam *ew;
388 double start;
385 389
386 if (_emotion_webcams_count <= 0) 390 if (_emotion_webcams_count <= 0)
387 { 391 {
@@ -415,6 +419,17 @@ emotion_shutdown(void)
415 eeze_shutdown(); 419 eeze_shutdown();
416#endif 420#endif
417 421
422 start = ecore_time_get();
423 while (emotion_pending_objects && ecore_time_get() - start < 0.5)
424 ecore_main_loop_iterate();
425
426 if (emotion_pending_objects)
427 {
428 EINA_LOG_ERR("There is still %i Emotion pipeline running", emotion_pending_objects);
429 }
430
431 ecore_shutdown();
432
418 return EINA_TRUE; 433 return EINA_TRUE;
419} 434}
420 435
@@ -455,3 +470,15 @@ emotion_webcam_custom_get(const char *device)
455 470
456 return NULL; 471 return NULL;
457} 472}
473
474EAPI void
475_emotion_pending_object_ref(void)
476{
477 emotion_pending_objects++;
478}
479
480EAPI void
481_emotion_pending_object_unref(void)
482{
483 emotion_pending_objects--;
484}
diff --git a/legacy/emotion/src/lib/emotion_private.h b/legacy/emotion/src/lib/emotion_private.h
index 4f9458fb34..62801fc7fa 100644
--- a/legacy/emotion/src/lib/emotion_private.h
+++ b/legacy/emotion/src/lib/emotion_private.h
@@ -128,4 +128,7 @@ EAPI Eina_Bool _emotion_module_unregister(const char *name);
128 128
129EAPI const char *emotion_webcam_custom_get(const char *device); 129EAPI const char *emotion_webcam_custom_get(const char *device);
130 130
131EAPI void _emotion_pending_object_ref(void);
132EAPI void _emotion_pending_object_unref(void);
133
131#endif 134#endif