summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-12-01 16:14:11 -0200
committerGuilherme Iscaro <iscaro@profusion.mobi>2016-12-02 11:30:28 -0200
commitb86712e8518dcadb00910c7b43e6cd0571a76f48 (patch)
treec9963b3a543d554c6ca7690c5464c8f0dafa197b
parent79f5062ba691b84888743ee69377f84028bc4f88 (diff)
downloadefl-b86712e8518dcadb00910c7b43e6cd0571a76f48.tar.gz
Efl.Input.Device: Do not ref/unref devices children devices.devs/iscaro/devices
When a mouse/keyboard is removed from its seat under the Wayland backend, it was not immediately deleted from EFL, because its parent was keeping a reference to it. Since the mouse/keyboard is no longer present in the system there's no reason the keep them around. To prevent this delayed deletion do not ref/unref them when the parent is set.
-rw-r--r--src/lib/efl/interfaces/efl_input_device.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/efl/interfaces/efl_input_device.c b/src/lib/efl/interfaces/efl_input_device.c
index bb59fc6447..f20063fda2 100644
--- a/src/lib/efl/interfaces/efl_input_device.c
+++ b/src/lib/efl/interfaces/efl_input_device.c
@@ -28,7 +28,11 @@ _efl_input_device_efl_object_destructor(Eo *obj, Efl_Input_Device_Data *pd)
{
Efl_Input_Device_Data *child = efl_data_scope_get(eo_child, EFL_INPUT_DEVICE_CLASS);
child->parent = NULL;
- efl_unref(eo_child);
+ }
+ if (pd->parent)
+ {
+ Efl_Input_Device_Data *p = efl_data_scope_get(pd->parent, EFL_INPUT_DEVICE_CLASS);
+ p->children = eina_list_remove(p->children, obj);
}
efl_unref(pd->source);
@@ -128,14 +132,12 @@ _efl_input_device_parent_set(Eo *obj, Efl_Input_Device_Data *pd, Efl_Input_Devic
{
Efl_Input_Device_Data *p = efl_data_scope_get(pd->parent, EFL_INPUT_DEVICE_CLASS);
p->children = eina_list_remove(p->children, obj);
- efl_unref(obj);
}
pd->parent = parent;
if (parent)
{
Efl_Input_Device_Data *p = efl_data_scope_get(parent, EFL_INPUT_DEVICE_CLASS);
p->children = eina_list_append(p->children, obj);
- efl_ref(obj);
}
}