summaryrefslogtreecommitdiff
path: root/src/lib/emotion/emotion_webcam.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:45 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:58 -0800
commit99142090b446fce4df509beaa9b1f3df915462ab (patch)
treead1ba8891f4949ab5b473ad728b24792eb9155ae /src/lib/emotion/emotion_webcam.c
parent21ba61be73f0c9109d40aee7759861ed04fadd35 (diff)
emotion: avoid crash during shutdown due to Ecore_Event queue.
Diffstat (limited to '')
-rw-r--r--src/lib/emotion/emotion_webcam.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/emotion/emotion_webcam.c b/src/lib/emotion/emotion_webcam.c
index fe3c949a46..7893e197e3 100644
--- a/src/lib/emotion/emotion_webcam.c
+++ b/src/lib/emotion/emotion_webcam.c
@@ -273,9 +273,12 @@ _emotion_enumerate_all_webcams(void)
273 273
274Eina_Bool emotion_webcam_init(void) 274Eina_Bool emotion_webcam_init(void)
275{ 275{
276 EMOTION_WEBCAM_UPDATE = ecore_event_type_new(); 276 if (EMOTION_WEBCAM_UPDATE == 0)
277 EMOTION_WEBCAM_ADD = ecore_event_type_new(); 277 {
278 EMOTION_WEBCAM_DEL = ecore_event_type_new(); 278 EMOTION_WEBCAM_UPDATE = ecore_event_type_new();
279 EMOTION_WEBCAM_ADD = ecore_event_type_new();
280 EMOTION_WEBCAM_DEL = ecore_event_type_new();
281 }
279 282
280 eet_init(); 283 eet_init();
281 _emotion_webcams_edds_new(); 284 _emotion_webcams_edds_new();
@@ -303,10 +306,14 @@ emotion_webcam_shutdown(void)
303 Emotion_Webcam *ew; 306 Emotion_Webcam *ew;
304 const char *syspath; 307 const char *syspath;
305 308
309 ecore_event_type_flush(EMOTION_WEBCAM_UPDATE,
310 EMOTION_WEBCAM_ADD,
311 EMOTION_WEBCAM_DEL);
312
306 if (_emotion_webcams->idler) 313 if (_emotion_webcams->idler)
307 { 314 {
308 ecore_idler_del(_emotion_webcams->idler); 315 ecore_idler_del(_emotion_webcams->idler);
309 _emotion_webcams->idler = NULL; 316 _emotion_webcams->idler = NULL;
310 } 317 }
311 318
312 EINA_LIST_FREE(_emotion_webcams->check_list, syspath) 319 EINA_LIST_FREE(_emotion_webcams->check_list, syspath)