yakov pushed a commit to branch master.

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

commit c25381e89f8e1daadd3887371c097316bdffb1eb
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Thu Nov 12 15:50:27 2015 +0200

    Refactoring _project_close()
---
 src/bin/gui/editor.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index 33988de..fdeee66 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -3895,21 +3895,17 @@ _project_close(const Gui_Context *ctx)
         _editor_layout_clear(_active_context_get());
 
         /* Iterate over windows and delete Main_Wdg_Info */
-        Eina_List *list, *itr, *itr2;
+        Eina_List *list, *itr;
         Eid *wdg_id;
-        list = gui_context_main_widgets_get(_active_context_get());
-        EINA_LIST_FOREACH_SAFE(list, itr, itr2, wdg_id)
+        Gui_Session *editor_session = (Gui_Session *) 
gui_context_editor_session_get(ctx);
+        list = gui_context_main_widgets_get(ctx);
+        EINA_LIST_FOREACH(list, itr, wdg_id)
           {
              Gui_Widget *wdg = wdg_get(wdg_id);
-             if (wdg)
-               {
-                  Main_Wdg_Info *wi = wdg_data_get(wdg, MAIN_WDG_INFO);
-                  if (wi) eo_del(wi->frame);
-                  free(wi);
-               }
+             manager_widget_delete(editor_session, wdg, NULL);
           }
 
-        session_del((Gui_Session *) gui_context_editor_session_get(ctx));
+        session_del(editor_session);
         gui_context_del((Gui_Context *) ctx);
      }
 }

-- 


Reply via email to