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

git pushed a commit to branch v-1.26.0
in repository efl.

View the commit online.

commit 3f000b6903d4c9f7fa1f97f2e19d88668cdb7f16
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Thu Mar 24 17:17:35 2022 +0000

    ecore-x - fix xkb emitted hash handling to del just that serial
    
    don't delete any item with a data of 1 which could be multiple
    items.... delete by the serial instead.
    
    also - don't leak the event... this leaks the event as the free func
    never freed the event...
    
    @fix
---
 src/lib/ecore_x/ecore_x_events.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/lib/ecore_x/ecore_x_events.c b/src/lib/ecore_x/ecore_x_events.c
index 220125b0bb..3b2f47ce61 100644
--- a/src/lib/ecore_x/ecore_x_events.c
+++ b/src/lib/ecore_x/ecore_x_events.c
@@ -2470,9 +2470,10 @@ _ecore_x_event_handle_generic_event(XEvent *event)
 #ifdef ECORE_XKB
 
 void
-free_hash(void *userdata EINA_UNUSED, void *funcdata EINA_UNUSED)
+free_hash(void *data, void *ev)
 {
-   eina_hash_del_by_data(emitted_events, (void*) 1);
+   eina_hash_del_by_key(emitted_events, (void *)&data);
+   if (ev) free(ev);
 }
 
 void
@@ -2502,8 +2503,9 @@ _ecore_x_event_handle_xkb(XEvent *xevent)
         e->base_mods = xkbev->state.base_mods;
         e->latched_mods = xkbev->state.latched_mods;
         e->locked_mods = xkbev->state.locked_mods;
-        ecore_event_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, e, free_hash, NULL);
-        eina_hash_add(emitted_events, &xkbev->state.serial, (void*) 1);
+        ecore_event_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, e, free_hash,
+                        (void *)(intptr_t)xkbev->new_kbd.serial);
+        eina_hash_add(emitted_events, &xkbev->state.serial, (void *)1);
      }
    else if ((xkbev->any.xkb_type == XkbNewKeyboardNotify) ||
             (xkbev->any.xkb_type == XkbMapNotify))
@@ -2528,8 +2530,9 @@ _ecore_x_event_handle_xkb(XEvent *xevent)
              XkbNewKeyboardNotifyEvent *xkbnkn = (void*)xkbev;
              if (!(xkbnkn->changed & XkbNKN_KeycodesMask)) return;
           }
-        ecore_event_add(ECORE_X_EVENT_XKB_NEWKBD_NOTIFY, NULL, free_hash, NULL);
-        eina_hash_add(emitted_events, &xkbev->new_kbd.serial, (void*) 1);
+        ecore_event_add(ECORE_X_EVENT_XKB_NEWKBD_NOTIFY, NULL, free_hash,
+                        (void *)(intptr_t)xkbev->new_kbd.serial);
+        eina_hash_add(emitted_events, &xkbev->new_kbd.serial, (void *)1);
      }
 }
 #endif /* ifdef ECORE_XKB */

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

Reply via email to