This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch up/output-remove
in repository enlightenment.
View the commit online.
commit cac46d8f5c2a508044e0e3a02ccaa0ca0fdb13b3
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 28 17:03:50 2026 -0600
e_pointer - forget the cursor objects of a canvas pointer when freed
The compositor's pointer draws with an edje object and a hotspot
rectangle on the compositor canvas, which ecore_evas keeps as its
cursor, and adds callbacks on both with the pointer as their data. The
pointer is freed by e_comp_canvas_clear(), but the objects only go
with the ecore_evas, later in _e_comp_free(): deleting the cursor
object then ran _del_cb() on the freed pointer, which wrote to it.
valgrind showed it at every Wayland shutdown, as an invalid read and an
invalid write in _del_cb() from _ecore_evas_cursor_element_del().
The pointer now removes its callbacks from the canvas' objects when it
is freed. A pointer drawn on its own buffer canvas deletes its objects
itself, as before.
e_pointer.c is shared with X11, whose suite passes as before.
No test can see a write to freed memory without a memory checker, so
this was checked with valgrind: wl-test-module, run with E under
valgrind, had 2 errors at shutdown and has none with this.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/bin/e_pointer.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/bin/e_pointer.c b/src/bin/e_pointer.c
index f26d6df2b..c073c019b 100644
--- a/src/bin/e_pointer.c
+++ b/src/bin/e_pointer.c
@@ -387,6 +387,21 @@ _e_pointer_cb_free(E_Pointer *ptr)
E_FREE_FUNC(ptr->idle_poll, ecore_poller_del);
if (ptr->buffer_evas) _e_pointer_canvas_del(ptr);
+ else
+ {
+ /* The cursor objects of a canvas pointer are the canvas', which
+ * deletes them after the pointer is gone. */
+ if (ptr->o_ptr)
+ {
+ efl_event_callback_del(ptr->o_ptr, EFL_EVENT_DEL, _del_cb, ptr);
+ evas_object_event_callback_del_full(ptr->o_ptr, EVAS_CALLBACK_MOVE,
+ _e_pointer_cb_hot_move, ptr);
+ }
+ evas_object_event_callback_del_full(ptr->o_hot, EVAS_CALLBACK_MOVE,
+ _e_pointer_cb_hot_move, ptr);
+ evas_object_event_callback_del_full(ptr->o_hot, EVAS_CALLBACK_SHOW,
+ _e_pointer_cb_hot_show, ptr);
+ }
free(ptr);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.