raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=d23c37169f4e613d10b0fb41e474d2ed1b521b68

commit d23c37169f4e613d10b0fb41e474d2ed1b521b68
Author: Lukasz Stanislawski <l.stanisl...@samsung.com>
Date:   Wed May 14 12:02:10 2014 +0900

    layout: remove sizing_eval call when layout is already destructed. @fix
    
    Summary:
    Layout's sub_object_del function calls sizing_eval even if layout's 
smart_del
    function has already been called (Due to widget_smart_del impl).
    This patch adds 'destructed_is' flag to Elm_Layout_Smart_Data and prevents 
unneeded
    sizing_eval calls when object is already destructed.
    Patch also fixes SIGSEGV in layout derived entry widget caused by calling
    sizing_eval after entry_smart_del destructor.
    
    Added entry test to avoid regression for SIGSEGV bug.
    
    Test Plan: run tests/elm_test_entry
    
    Reviewers: raster, seoz, tasn, cedric
    
    Differential Revision: https://phab.enlightenment.org/D823
---
 src/lib/elm_layout.c        |  3 +++
 src/lib/elm_widget_layout.h |  1 +
 src/tests/Makefile.am       |  1 +
 src/tests/elm_suite.c       |  1 +
 src/tests/elm_suite.h       |  1 +
 src/tests/elm_test_entry.c  | 25 +++++++++++++++++++++++++
 6 files changed, 32 insertions(+)

diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 0e62d89..d6fa3fc 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -520,6 +520,7 @@ _elm_layout_elm_widget_sub_object_del(Eo *obj, 
Elm_Layout_Smart_Data *sd, Evas_O
 
    eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj));
    if (!int_ret) return EINA_FALSE;
+   if (sd->destructed_is) return EINA_TRUE;
 
    EINA_LIST_FOREACH(sd->subs, l, sub_d)
      {
@@ -799,6 +800,8 @@ _elm_layout_evas_smart_del(Eo *obj, Elm_Layout_Smart_Data 
*sd)
           }
      }
 
+   sd->destructed_is = EINA_TRUE;
+
    eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
 }
 
diff --git a/src/lib/elm_widget_layout.h b/src/lib/elm_widget_layout.h
index 0d7b8d7..f005dd9 100644
--- a/src/lib/elm_widget_layout.h
+++ b/src/lib/elm_widget_layout.h
@@ -77,6 +77,7 @@ typedef struct _Elm_Layout_Smart_Data
    Eina_Bool             restricted_calc_w : 1;
    Eina_Bool             restricted_calc_h : 1;
    Eina_Bool             can_access : 1; /**< This is true when all 
text(including textblock) parts can be accessible by accessibility. */
+   Eina_Bool             destructed_is : 1; /**< This flag indicates if 
Elm_Layout destructor was called */
 } Elm_Layout_Smart_Data;
 
 /**
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 84c763b..200ada7 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -8,6 +8,7 @@ elm_suite_SOURCES = \
        elm_suite.c \
        elm_test_check.c \
        elm_test_colorselector.c \
+       elm_test_entry.c \
        elm_test_init.c
 
 elm_suite_CPPFLAGS = \
diff --git a/src/tests/elm_suite.c b/src/tests/elm_suite.c
index 7056b35..f586833 100644
--- a/src/tests/elm_suite.c
+++ b/src/tests/elm_suite.c
@@ -17,6 +17,7 @@ static const Elementary_Test_Case etc[] = {
   { "Elementary", elm_test_init },
   { "elm_check", elm_test_check },
   { "elm_colorselector", elm_test_colorselector },
+  { "elm_entry", elm_test_entry},
   { NULL, NULL }
 };
 
diff --git a/src/tests/elm_suite.h b/src/tests/elm_suite.h
index 3d4be29..bac0a56 100644
--- a/src/tests/elm_suite.h
+++ b/src/tests/elm_suite.h
@@ -6,5 +6,6 @@
 void elm_test_init(TCase *tc);
 void elm_test_check(TCase *tc);
 void elm_test_colorselector(TCase *tc);
+void elm_test_entry(TCase *tc);
 
 #endif /* _ELM_SUITE_H */
diff --git a/src/tests/elm_test_entry.c b/src/tests/elm_test_entry.c
new file mode 100644
index 0000000..70643ae
--- /dev/null
+++ b/src/tests/elm_test_entry.c
@@ -0,0 +1,25 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Elementary.h>
+#include "elm_suite.h"
+
+START_TEST (elm_entry_del)
+{
+   Evas_Object *win, *entry;
+
+   elm_init(1, NULL);
+   win = elm_win_add(NULL, "check", ELM_WIN_BASIC);
+
+   entry = elm_entry_add(win);
+   elm_object_text_set(entry, "TEST");
+
+   elm_shutdown();
+}
+END_TEST
+
+void elm_test_entry(TCase *tc)
+{
+   tcase_add_test(tc, elm_entry_del);
+}

-- 


Reply via email to