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

git pushed a commit to branch reproducible-widget-previews
in repository efl.

View the commit online.

commit 724865f53644b9fc9ff83611637770b93963a9ef
Author: Cedric BAIL <[email protected]>
AuthorDate: Wed Mar 18 21:46:10 2026 -0600

    focus_util: use weak refs for delayed focus object to prevent stale access
    
    _efl_ui_focus_util_focus stores a delayed-focus object pointer on
    the top widget using efl_key_data_set (a raw pointer with no
    lifecycle tracking). If the referenced object is deleted before the
    next focus attempt, the pointer becomes stale and efl_event_callback_del
    operates on an invalid Eo ID, producing:
      efl_event_callback_del() Eo ID ... is not a valid object
    
    Switch to efl_key_wref_set/efl_key_wref_get which use weak references.
    The stored pointer is automatically NULLed when the referenced object
    is destroyed, so the stale access can no longer occur.
    
    Made-with: Cursor
---
 src/lib/elementary/efl_ui_focus_util.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_focus_util.c b/src/lib/elementary/efl_ui_focus_util.c
index 891489773e..06ecbffb72 100644
--- a/src/lib/elementary/efl_ui_focus_util.c
+++ b/src/lib/elementary/efl_ui_focus_util.c
@@ -33,9 +33,9 @@ _efl_ui_focus_util_focus(Efl_Ui_Focus_Object *user)
 
    top = elm_widget_top_get(user);
 
-   o = efl_key_data_get(top, "__delayed_focus_set");
+   o = efl_key_wref_get(top, "__delayed_focus_set");
    if (o) efl_event_callback_del(o, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED, _manager_changed, o);
-   efl_key_data_set(top, "__delayed_focus_set", NULL);
+   efl_key_wref_set(top, "__delayed_focus_set", NULL);
 
    registered_manager = m = efl_ui_focus_object_focus_manager_get(user);
    entry = user;
@@ -52,7 +52,7 @@ _efl_ui_focus_util_focus(Efl_Ui_Focus_Object *user)
 
    if (!m)
      {
-        efl_key_data_set(top, "__delayed_focus_set", entry);
+        efl_key_wref_set(top, "__delayed_focus_set", entry);
         efl_event_callback_add(entry,
                                EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_MANAGER_CHANGED,
                                _manager_changed, user);

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

Reply via email to