forked from enlightenment/efl
edbus: omit InterfacesAdded/InterfacesRemoved signal if we can
If we add and remove the interfaces in the same mainloop iteration, there's no point in sending the signals at all. Let's just omit them since it's likely because the rest of the intialization for having them failed. SVN revision: 82907
This commit is contained in:
parent
57ac8b0b95
commit
ae8761f809
|
@ -974,6 +974,7 @@ _interface_free(EDBus_Service_Interface *interface)
|
||||||
{
|
{
|
||||||
const char *sig;
|
const char *sig;
|
||||||
EDBus_Service_Object *obj;
|
EDBus_Service_Object *obj;
|
||||||
|
Eina_List *l;
|
||||||
|
|
||||||
if (interface == introspectable || interface == properties_iface ||
|
if (interface == introspectable || interface == properties_iface ||
|
||||||
interface == objmanager)
|
interface == objmanager)
|
||||||
|
@ -992,18 +993,26 @@ _interface_free(EDBus_Service_Interface *interface)
|
||||||
eina_array_free(interface->prop_invalidated);
|
eina_array_free(interface->prop_invalidated);
|
||||||
|
|
||||||
obj = interface->obj;
|
obj = interface->obj;
|
||||||
if (!obj->idler_iface_changed)
|
l = eina_list_data_find(obj->iface_added, interface);
|
||||||
obj->idler_iface_changed = ecore_idler_add(_object_manager_changes_process,
|
if (l)
|
||||||
obj);
|
{
|
||||||
obj->iface_removed = eina_list_append(obj->iface_removed,
|
/* Adding and removing the interface in the same main loop iteration.
|
||||||
eina_stringshare_ref(interface->name));
|
* Let's not send any signal */
|
||||||
/*
|
obj->iface_added = eina_list_remove_list(obj->iface_added, l);
|
||||||
* TODO: properly fix the case in which the interface appears in both
|
if (!obj->iface_added && !obj->iface_removed && obj->idler_iface_changed)
|
||||||
* iface_added and iface_removed list. If we only remove it like below we
|
obj->idler_iface_changed = ecore_idler_del(obj->idler_iface_changed);
|
||||||
* will end up sending InterfacesRemoved signal for an interface that never
|
}
|
||||||
* generated an InterfacesAdded signal. In this case it's better not to send
|
else
|
||||||
* the signal but we are sending both.
|
{
|
||||||
*/
|
if (!obj->idler_iface_changed)
|
||||||
|
{
|
||||||
|
obj->idler_iface_changed = ecore_idler_add(
|
||||||
|
_object_manager_changes_process, obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
obj->iface_removed = eina_list_append(
|
||||||
|
obj->iface_removed, eina_stringshare_ref(interface->name));
|
||||||
|
}
|
||||||
|
|
||||||
eina_stringshare_del(interface->name);
|
eina_stringshare_del(interface->name);
|
||||||
free(interface);
|
free(interface);
|
||||||
|
|
Loading…
Reference in New Issue