summaryrefslogtreecommitdiff
path: root/src/lib/eio
diff options
context:
space:
mode:
authorIvan Furs <i.furs@samsung.com>2016-12-27 16:20:58 +0200
committerMykyta Biliavskyi <m.biliavskyi@samsung.com>2016-12-27 16:20:59 +0200
commit3df48e281e44501b797c012c4bef32cd0090fa9c (patch)
treee3f7c02947236cd7b2796ca662824a05c5a4bfb5 /src/lib/eio
parentea66c8302a20b268cf67230c5d237773e4c6697d (diff)
eio: Correct deletion backend
Summary: This patch fixes the bug Fileselector. When backend is deleted need to remove event handler from the list. This commit adds ecore_main_win32_handler_del for correct clean handlers for cases when monitor backend was created by eio_monitor_backend_add(Windows method) or eio_monitor_fallback_add. To remove them needed to use eio_monitor_backend_del(Windows method) or eio_monitor_fallback_del. To identify the method which should free backend was added flag monitor->fallback instead of using static _eio_monitor_win32_native. This solves conflicts if 2 monitors was created and the second monitor changed the _eio_monitor_win32_native variable value. When 1 monitor removed it will be deleted correctly . @fix Reviewers: NikaWhite Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4518
Diffstat (limited to 'src/lib/eio')
-rw-r--r--src/lib/eio/eio_monitor_win32.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/eio/eio_monitor_win32.c b/src/lib/eio/eio_monitor_win32.c
index 60f9aa35c4..05374f1c76 100644
--- a/src/lib/eio/eio_monitor_win32.c
+++ b/src/lib/eio/eio_monitor_win32.c
@@ -56,8 +56,6 @@ struct _Eio_Monitor_Backend
56 Eio_Monitor_Win32_Watcher *watcher_parent; 56 Eio_Monitor_Win32_Watcher *watcher_parent;
57}; 57};
58 58
59static Eina_Bool _eio_monitor_win32_native = EINA_FALSE;
60
61static Eina_Bool 59static Eina_Bool
62_eio_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh EINA_UNUSED) 60_eio_monitor_win32_cb(void *data, Ecore_Win32_Handler *wh EINA_UNUSED)
63{ 61{
@@ -313,6 +311,7 @@ _eio_monitor_win32_watcher_free(Eio_Monitor_Win32_Watcher *w)
313{ 311{
314 if (!w) return; 312 if (!w) return;
315 313
314 ecore_main_win32_handler_del(w->h);
316 eina_stringshare_del(w->file); 315 eina_stringshare_del(w->file);
317 eina_stringshare_del(w->current); 316 eina_stringshare_del(w->current);
318 CloseHandle(w->event); 317 CloseHandle(w->event);
@@ -402,7 +401,7 @@ void eio_monitor_backend_add(Eio_Monitor *monitor)
402 if (!backend->watcher_parent) 401 if (!backend->watcher_parent)
403 goto free_backend_dir; 402 goto free_backend_dir;
404 403
405 _eio_monitor_win32_native = EINA_TRUE; 404 monitor->fallback = EINA_FALSE;
406 monitor->backend = backend; 405 monitor->backend = backend;
407 406
408 eina_stringshare_del(current); 407 eina_stringshare_del(current);
@@ -418,13 +417,13 @@ void eio_monitor_backend_add(Eio_Monitor *monitor)
418 free(backend); 417 free(backend);
419 fallback: 418 fallback:
420 INF("falling back to poll monitoring"); 419 INF("falling back to poll monitoring");
421 _eio_monitor_win32_native = EINA_FALSE; 420 monitor->fallback = EINA_TRUE;
422 eio_monitor_fallback_add(monitor); 421 eio_monitor_fallback_add(monitor);
423} 422}
424 423
425void eio_monitor_backend_del(Eio_Monitor *monitor) 424void eio_monitor_backend_del(Eio_Monitor *monitor)
426{ 425{
427 if (!_eio_monitor_win32_native) 426 if (monitor->fallback)
428 { 427 {
429 eio_monitor_fallback_del(monitor); 428 eio_monitor_fallback_del(monitor);
430 return; 429 return;