jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=3089fe6ba06ecdea9a0dfb55bbeae084932c45e2

commit 3089fe6ba06ecdea9a0dfb55bbeae084932c45e2
Author: Daniel Zaoui <daniel.za...@samsung.com>
Date:   Thu Sep 3 13:25:26 2015 +0300

    Edc: fix monitoring
    
    No need to del and then re-add a monitor on a same file
---
 src/bin/gui/editor.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index 1b4b40d..f0e801f 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -1478,12 +1478,13 @@ _widget_prop_add(Gui_Session *session, const Gui_Widget 
*wdg, const Gui_Widget_P
                     }
 
                   Ecore_File_Monitor *mon = resource_edc_monitor_get(res);
-                  if (mon) ecore_file_monitor_del(mon);
-
-                  mon = ecore_file_monitor_add(edc_file, _edc_file_updated, 
res);
-                  resource_edc_monitor_set(res, mon);
+                  if (!mon)
+                    {
+                       mon = ecore_file_monitor_add(edc_file, 
_edc_file_updated, res);
+                       resource_edc_monitor_set(res, mon);
+                       _edc_file_updated(res, mon, ECORE_FILE_EVENT_MODIFIED, 
NULL);
+                    }
 
-                  _edc_file_updated(res, mon, ECORE_FILE_EVENT_MODIFIED, NULL);
                }
           }
      }

-- 


Reply via email to