Page MenuHomePhabricator

Improve lifecycle of Child model
Open, HighPublic

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 ?

cedric created this task.Thu, Dec 27, 1:39 PM
cedric triaged this task as High priority.
zmike edited projects, added efl (efl-1.22), efl: mvvm; removed Restricted Project.Wed, Jan 9, 12:22 PM
zmike moved this task from Backlog to Cedric on the efl: mvvm board.