diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-12-19 11:14:37 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-12-19 11:14:37 +0900 |
commit | ff24ac2d6ddaafba49ae5100f17fe37e5d874140 (patch) | |
tree | b98881dd9ccb98896bbc8784a91e6b61a7403b41 /src/lib/elput | |
parent | 47bf356435d7b4562e64f45ef59dbf190dff16c7 (diff) | |
download | efl-ff24ac2d6ddaafba49ae5100f17fe37e5d874140.tar.gz |
efl: Reset ecore event types on init
This fixes cycles of init/shutdown/init where ecore event types would
become invalid, since they are now stored in a dynamic array rather than
a statically stored array.
The risk here is that if a module of EFL tends to init/shutdown in a
"normal" scenario then the event type array will grow in a leaking
manner. This could be fixed by resetting those event ID's only when the
loop actually exits (EFL_EVENT_DEL on the main loop). I'm not using
EFL_EVENT_DEL in this patch as this would add too many event callbacks
to the main loop object, which may result in slightly slower event calls
to it, affecting the overall performance.
Diffstat (limited to 'src/lib/elput')
-rw-r--r-- | src/lib/elput/elput.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/lib/elput/elput.c b/src/lib/elput/elput.c index f3cda411ea..503e5b57f0 100644 --- a/src/lib/elput/elput.c +++ b/src/lib/elput/elput.c @@ -33,18 +33,15 @@ elput_init(void) goto log_err; } - if (ELPUT_EVENT_SEAT_CAPS == 0) - { - ELPUT_EVENT_SEAT_CAPS = ecore_event_type_new(); - ELPUT_EVENT_SEAT_FRAME = ecore_event_type_new(); - ELPUT_EVENT_KEYMAP_SEND = ecore_event_type_new(); - ELPUT_EVENT_MODIFIERS_SEND = ecore_event_type_new(); - ELPUT_EVENT_DEVICE_CHANGE = ecore_event_type_new(); - ELPUT_EVENT_SESSION_ACTIVE = ecore_event_type_new(); - ELPUT_EVENT_POINTER_MOTION = ecore_event_type_new(); - ELPUT_EVENT_SWITCH = ecore_event_type_new(); - elput_event_session_ready = ecore_event_type_new(); - } + ELPUT_EVENT_SEAT_CAPS = ecore_event_type_new(); + ELPUT_EVENT_SEAT_FRAME = ecore_event_type_new(); + ELPUT_EVENT_KEYMAP_SEND = ecore_event_type_new(); + ELPUT_EVENT_MODIFIERS_SEND = ecore_event_type_new(); + ELPUT_EVENT_DEVICE_CHANGE = ecore_event_type_new(); + ELPUT_EVENT_SESSION_ACTIVE = ecore_event_type_new(); + ELPUT_EVENT_POINTER_MOTION = ecore_event_type_new(); + ELPUT_EVENT_SWITCH = ecore_event_type_new(); + elput_event_session_ready = ecore_event_type_new(); return _elput_init_count; |