elm_test_widget_focus: cleanup callbacks correctly
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Thu, 19 Sep 2019 12:43:31 +0000 (14:43 +0200)
committerJongmin Lee <jm105.lee@samsung.com>
Fri, 20 Sep 2019 21:08:45 +0000 (06:08 +0900)
we need to delete the callback here, otherwise the objects are deleted
later on, which:
- changes focus, which leads to
- callbacks executed with stacked addresses from a dead function

this fixes a testsuite failure on the release build.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10020

src/tests/elementary/elm_test_widget_focus.c

index d41889b..fb2a5a2 100644 (file)
@@ -201,6 +201,8 @@ EFL_START_TEST(elm_test_widget_focus_simple_widget)
          ck_assert_int_eq(flag_unfocused, EINA_TRUE);
          ck_assert_int_eq(elm_object_focus_get(resettor), EINA_TRUE);
          ck_assert_int_eq(elm_object_focus_get(o), EINA_FALSE);
+         evas_object_smart_callback_del_full(o, "focused", _eventing_test, &flag_focused);
+         evas_object_smart_callback_del_full(o, "unfocused", _eventing_test, &flag_unfocused);
       }
 
    eina_hash_free(map);