summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2016-08-16 22:56:16 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2016-08-16 22:57:09 +0300
commitf652b6e18f17e17ef67c5086f1a09944f8dd033f (patch)
treec6cb0222e750f6a1b271e965f687bb9c054bd5c0
parentfdab8ed5b6ba8a595e80b0e159c9ff7884db7a5e (diff)
Evas.Smart: Store event string in the spec to ensure it doesn't get decreffed
This fixes event string corruption and segfault in epymc
-rw-r--r--efl/evas/efl.evas_object_smart.pxi6
1 files changed, 4 insertions, 2 deletions
diff --git a/efl/evas/efl.evas_object_smart.pxi b/efl/evas/efl.evas_object_smart.pxi
index e3aae3b..2e71f66 100644
--- a/efl/evas/efl.evas_object_smart.pxi
+++ b/efl/evas/efl.evas_object_smart.pxi
@@ -381,6 +381,7 @@ cdef void _smart_object_member_del(Evas_Object *o, Evas_Object *clip) with gil:
381cdef class _SmartCb: 381cdef class _SmartCb:
382 cdef: 382 cdef:
383 SmartObject obj 383 SmartObject obj
384 bytes event
384 object(*event_conv)(void*) 385 object(*event_conv)(void*)
385 uintptr_t conv 386 uintptr_t conv
386 object func 387 object func
@@ -873,6 +874,7 @@ cdef class SmartObject(Object):
873 874
874 spec = _SmartCb.__new__(_SmartCb) 875 spec = _SmartCb.__new__(_SmartCb)
875 spec.obj = self 876 spec.obj = self
877 spec.event = event
876 spec.event_conv = event_conv 878 spec.event_conv = event_conv
877 spec.func = func 879 spec.func = func
878 spec.args = args 880 spec.args = args
@@ -881,9 +883,9 @@ cdef class SmartObject(Object):
881 lst = <list>self._smart_callback_specs.setdefault(event, []) 883 lst = <list>self._smart_callback_specs.setdefault(event, [])
882 if not lst: 884 if not lst:
883 evas_object_smart_callback_add(self.obj, 885 evas_object_smart_callback_add(self.obj,
884 <const char*>event, 886 <const char*>spec.event,
885 _smart_callback, 887 _smart_callback,
886 <void *>event 888 <void *>spec.event
887 ) 889 )
888 lst.append(spec) 890 lst.append(spec)
889 891