Page MenuHomePhabricator

Improve lifecycle of Child model
Closed, ResolvedPublic

Description

When a Efl.Model does create a Child Model object as requested by children_slice_get, the lifecycle isn't that clear on the user I think. Basically, the parent of a Child Model must be the Efl.Model that created it at all time. So children_slice_get return an accessor that keep a reference on the Child until the accessor is destroyed. At that point there is still the parent, so the child is still surviving. A view, should still reference all the Child model it keep, but once it is done, it ends up with noref and still a parent and so survive.

I think this should be fixed by using EFL_EVENT_NOREF to automatically destroy a child. Now the question is who does that. For efl_part, we have a function that does generate the automatic death of a part that has noref. For children_slice_get there isn't really an equivalent function. So we can either add one, add a protected property on Efl.Model, something else ? Any idea, suggestions ?