eo: do not NULL out the object itself

otherwise we would not free it in the next run over the vtable. Which
would result in a leak.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11574
This commit is contained in:
Marcel Hollerbach 2020-03-24 14:39:10 +01:00
parent 9738a75939
commit f80cfa4893
1 changed files with 7 additions and 4 deletions

View File

@ -175,16 +175,19 @@ _vtable_mro_free(const _Efl_Class *klass)
{
const _Efl_Class **mro_itr = klass->mro;
const Eo_Vtable *vtable = &klass->vtable;
for ( ; *mro_itr ; mro_itr++)
{
const Eo_Vtable *mro_vtable = &(*mro_itr)->vtable;
if ((*mro_itr) == klass)
continue;
for (int i = 0; i < mro_vtable->size; ++i)
for (unsigned int i = 0; i < mro_vtable->size; ++i)
{
if (mro_vtable->chain[i].funcs == vtable->chain[i].funcs)
vtable->chain[i].funcs = NULL;
if (i == klass->class_id)
continue;
if (vtable->chain[i].funcs && mro_vtable->chain[i].funcs == vtable->chain[i].funcs)
{
vtable->chain[i].funcs = NULL;
}
}
}
}