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)
downloadefl-ebdc0f07a14074689b0941da3f9fe4fdb75abb41.tar.gz
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 @@
2012-06-19 Cedric Bail
* Sync rendering with Ecore_Animator.
+
+2012-06-03 Cedric Bail
+
+ * 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:
- Add support for "playback_started" callback to generic player.
- Implement SPU switch for generic/vlc.
- Sync rendering with Ecore_Animator.
+ - Track pending object for proper shutdown.
Fixes:
- 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)
evas_font_cache_set(evas, 1 * 1024 * 1024);
evas_font_path_append(evas, PACKAGE_DATA_DIR"/data/fonts");
+ emotion_init();
+
bg_setup();
for (; args < argc; args++)
@@ -729,6 +731,8 @@ main(int argc, char **argv)
ecore_main_loop_begin();
main_signal_exit(NULL, 0, NULL);
+
+ emotion_shutdown();
ecore_evas_free(ecore_evas);
ecore_evas_shutdown();
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);
#include "emotion_private.h"
static Emotion_Version _version = { VMAJ, VMIN, VMIC, VREV };
+static int emotion_pending_objects = 0;
EAPI Emotion_Version *emotion_version = &_version;
EAPI int EMOTION_WEBCAM_UPDATE = 0;
@@ -343,6 +344,8 @@ emotion_init(void)
if (_emotion_webcams_count++) return EINA_TRUE;
+ ecore_init();
+
snprintf(buffer, 4096, "%s/emotion.cfg", PACKAGE_DATA_DIR);
_emotion_webcams_file = eet_open(buffer, EET_FILE_MODE_READ);
if (_emotion_webcams_file)
@@ -382,6 +385,7 @@ EAPI Eina_Bool
emotion_shutdown(void)
{
Emotion_Webcam *ew;
+ double start;
if (_emotion_webcams_count <= 0)
{
@@ -415,6 +419,17 @@ emotion_shutdown(void)
eeze_shutdown();
#endif
+ start = ecore_time_get();
+ while (emotion_pending_objects && ecore_time_get() - start < 0.5)
+ ecore_main_loop_iterate();
+
+ if (emotion_pending_objects)
+ {
+ EINA_LOG_ERR("There is still %i Emotion pipeline running", emotion_pending_objects);
+ }
+
+ ecore_shutdown();
+
return EINA_TRUE;
}
@@ -455,3 +470,15 @@ emotion_webcam_custom_get(const char *device)
return NULL;
}
+
+EAPI void
+_emotion_pending_object_ref(void)
+{
+ emotion_pending_objects++;
+}
+
+EAPI void
+_emotion_pending_object_unref(void)
+{
+ emotion_pending_objects--;
+}
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);
EAPI const char *emotion_webcam_custom_get(const char *device);
+EAPI void _emotion_pending_object_ref(void);
+EAPI void _emotion_pending_object_unref(void);
+
#endif