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.
This commit is contained in:
Davide Andreoli 2016-01-18 21:24:26 +01:00
parent 458121f6be
commit fc68b43317
1 changed files with 7 additions and 1 deletions

View File

@ -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: