davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=fc68b43317fdacaeb02d5785fe1fb2c31b499d40

commit fc68b43317fdacaeb02d5785fe1fb2c31b499d40
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Mon Jan 18 21:24:26 2016 +0100

    ecore_con.Url: do not fail when receiving an event that is not for us.
    
    The url callbacks are called for EVERY ecore_con usage, object_from_instance
    can fail in case the Url is not generated from us (for example an elm Image 
that
    load the data from the net). So just ignore those events.
---
 efl/ecore_con/efl.ecore_con.pyx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/efl/ecore_con/efl.ecore_con.pyx b/efl/ecore_con/efl.ecore_con.pyx
index 2d2f094..af14c88 100644
--- a/efl/ecore_con/efl.ecore_con.pyx
+++ b/efl/ecore_con/efl.ecore_con.pyx
@@ -227,7 +227,13 @@ cdef Eina_Bool _con_event_filter_cb(void *data, int 
ev_type, void *ev) with gil:
     event_cls = _event_mapping_get(ev_type)
     if event_cls:
         py_event = event_cls()
-        py_event._set_obj(ev)
+
+        # object_from_instance can fail in _set_obj if the event is
+        # generated from an object not managed by us, so just ignore it.
+        try:
+            py_event._set_obj(ev)
+        except:
+            return 1
 
         # do we have callbacks for this object/event ?
         try:

-- 


Reply via email to