summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:10 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-03-09 16:17:58 -0800
commitc91b4c70653527546afbc324b94e4ed60cdfd784 (patch)
tree6481ff95e5eac80a0781f3fd06b5be78bc0d8a6a
parent93b63b48e862c1ee5c217abeede05a5533c96ed7 (diff)
elput: avoid crash during shutdown due to Ecore_Event queue.
-rw-r--r--src/lib/elput/elput.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/lib/elput/elput.c b/src/lib/elput/elput.c
index 561c98addd..f0c7a9027b 100644
--- a/src/lib/elput/elput.c
+++ b/src/lib/elput/elput.c
@@ -6,13 +6,13 @@ static int _elput_init_count = 0;
6/* external variables */ 6/* external variables */
7int _elput_log_dom = -1; 7int _elput_log_dom = -1;
8 8
9EAPI int ELPUT_EVENT_SEAT_CAPS = -1; 9EAPI int ELPUT_EVENT_SEAT_CAPS = 0;
10EAPI int ELPUT_EVENT_SEAT_FRAME = -1; 10EAPI int ELPUT_EVENT_SEAT_FRAME = 0;
11EAPI int ELPUT_EVENT_KEYMAP_SEND = -1; 11EAPI int ELPUT_EVENT_KEYMAP_SEND = 0;
12EAPI int ELPUT_EVENT_MODIFIERS_SEND = -1; 12EAPI int ELPUT_EVENT_MODIFIERS_SEND = 0;
13EAPI int ELPUT_EVENT_DEVICE_CHANGE = -1; 13EAPI int ELPUT_EVENT_DEVICE_CHANGE = 0;
14EAPI int ELPUT_EVENT_SESSION_ACTIVE = -1; 14EAPI int ELPUT_EVENT_SESSION_ACTIVE = 0;
15EAPI int ELPUT_EVENT_POINTER_MOTION = -1; 15EAPI int ELPUT_EVENT_POINTER_MOTION = 0;
16 16
17EAPI int 17EAPI int
18elput_init(void) 18elput_init(void)
@@ -31,13 +31,16 @@ elput_init(void)
31 goto log_err; 31 goto log_err;
32 } 32 }
33 33
34 ELPUT_EVENT_SEAT_CAPS = ecore_event_type_new(); 34 if (ELPUT_EVENT_SEAT_CAPS == 0)
35 ELPUT_EVENT_SEAT_FRAME = ecore_event_type_new(); 35 {
36 ELPUT_EVENT_KEYMAP_SEND = ecore_event_type_new(); 36 ELPUT_EVENT_SEAT_CAPS = ecore_event_type_new();
37 ELPUT_EVENT_MODIFIERS_SEND = ecore_event_type_new(); 37 ELPUT_EVENT_SEAT_FRAME = ecore_event_type_new();
38 ELPUT_EVENT_DEVICE_CHANGE = ecore_event_type_new(); 38 ELPUT_EVENT_KEYMAP_SEND = ecore_event_type_new();
39 ELPUT_EVENT_SESSION_ACTIVE = ecore_event_type_new(); 39 ELPUT_EVENT_MODIFIERS_SEND = ecore_event_type_new();
40 ELPUT_EVENT_POINTER_MOTION = ecore_event_type_new(); 40 ELPUT_EVENT_DEVICE_CHANGE = ecore_event_type_new();
41 ELPUT_EVENT_SESSION_ACTIVE = ecore_event_type_new();
42 ELPUT_EVENT_POINTER_MOTION = ecore_event_type_new();
43 }
41 44
42 return _elput_init_count; 45 return _elput_init_count;
43 46
@@ -59,13 +62,13 @@ elput_shutdown(void)
59 if (_elput_init_count < 1) return 0; 62 if (_elput_init_count < 1) return 0;
60 if (--_elput_init_count != 0) return _elput_init_count; 63 if (--_elput_init_count != 0) return _elput_init_count;
61 64
62 ELPUT_EVENT_SEAT_CAPS = -1; 65 ecore_event_type_flush(ELPUT_EVENT_SEAT_CAPS,
63 ELPUT_EVENT_SEAT_FRAME = -1; 66 ELPUT_EVENT_SEAT_FRAME,
64 ELPUT_EVENT_KEYMAP_SEND = -1; 67 ELPUT_EVENT_KEYMAP_SEND,
65 ELPUT_EVENT_MODIFIERS_SEND = -1; 68 ELPUT_EVENT_MODIFIERS_SEND,
66 ELPUT_EVENT_DEVICE_CHANGE = -1; 69 ELPUT_EVENT_DEVICE_CHANGE,
67 ELPUT_EVENT_SESSION_ACTIVE = -1; 70 ELPUT_EVENT_SESSION_ACTIVE,
68 ELPUT_EVENT_POINTER_MOTION = -1; 71 ELPUT_EVENT_POINTER_MOTION);
69 72
70 eina_log_domain_unregister(_elput_log_dom); 73 eina_log_domain_unregister(_elput_log_dom);
71 _elput_log_dom = -1; 74 _elput_log_dom = -1;