This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit 2837b491588ebc490eaa06e85829e9f9e2a9b87f
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 8 16:02:39 2026 -0600

    efl: an unused part proxy is released once when its parent goes
    
    efl_part() hands out a proxy with an extra ref, armed to drop it at the
    end of its next call, and a NOREF handler that deletes the proxy when it
    does. A proxy nobody used (efl_isa(efl_part(win, "bg"), ...), as the
    bindings do) has the invalidation by its parent as its next call. Traced
    with gdb: _efl_invalidate(win) -> efl_parent_set(part, NULL) ->
    _efl_invalidate(part) -> efl_invalidate() dispatch ends -> armed auto
    unref -> efl_unref() fires NOREF -> _noref_death() -> efl_del(part) ->
    efl_parent_set(part, NULL) releases the parent's ref; back in the
    outer efl_parent_set(part, NULL), the parent's ref is released again:
    "Too many unrefs". _noref_death() now leaves a proxy that is already
    invalidating to the invalidation that is deleting it. A new test deletes
    a window holding an unused proxy (it aborted on the ERR before).
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/lib/efl/interfaces/efl_interfaces_main.c |  5 +++++
 src/tests/elementary/efl_ui_test_win.c       | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index 4856df5a6e..74e538a8e2 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -82,6 +82,11 @@ static void
 _noref_death(void *data EINA_UNUSED, const Efl_Event *event)
 {
    efl_event_callback_del(event->object, EFL_EVENT_NOREF, _noref_death, NULL);
+   // A proxy that nobody used is armed to drop its extra ref at its next call,
+   // which can be the call that invalidates it with its parent: its parent is
+   // then already letting go of it, and a second efl_del would release the
+   // parent's reference twice ("Too many unrefs").
+   if (efl_invalidating_get(event->object)) return;
    efl_del(event->object);
 }
 
diff --git a/src/tests/elementary/efl_ui_test_win.c b/src/tests/elementary/efl_ui_test_win.c
index 685d233d2a..560994fdd4 100644
--- a/src/tests/elementary/efl_ui_test_win.c
+++ b/src/tests/elementary/efl_ui_test_win.c
@@ -546,6 +546,21 @@ EFL_START_TEST(efl_ui_win_test_background_replace)
 }
 EFL_END_TEST
 
+// A part proxy that no call ever used: efl_part() armed it to drop its extra ref
+// at the end of its next call, and the next call is its own deletion with the
+// window. It must be released once, not twice.
+EFL_START_TEST(efl_ui_win_test_part_proxy_unused)
+{
+   Efl_Ui_Win *win;
+
+   win = efl_new(EFL_UI_WIN_CLASS);
+   ck_assert_ptr_ne(efl_part(win, "background"), NULL);
+   fail_on_errors_setup();
+   evas_object_del(win);
+   fail_on_errors_teardown();
+}
+EFL_END_TEST
+
 EFL_START_TEST(efl_ui_win_test_type)
 {
    Efl_Ui_Win *win;
@@ -871,6 +886,7 @@ efl_ui_test_win(TCase *tc)
    tcase_add_test(tc, efl_ui_win_test_rotation_normalized);
    tcase_add_test(tc, efl_ui_win_test_type);
    tcase_add_test(tc, efl_ui_win_test_content_replaced);
+   tcase_add_test(tc, efl_ui_win_test_part_proxy_unused);
    tcase_add_test(tc, efl_ui_win_test_background_replace);
    tcase_add_test(tc, efl_ui_win_test_content_replace_and_unset);
    tcase_add_test(tc, efl_ui_win_test_background_unset);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to