diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-24 14:39:10 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-24 20:41:19 +0100 |
commit | f80cfa4893e1164284892592575c4b75fb0be333 (patch) | |
tree | 5cf1dac97fdb35e3aa7572a7c303ad3c40fdf3a4 | |
parent | 9738a759392d1c78ed469bbed40139a6c6d12a64 (diff) | |
download | efl-f80cfa4893e1164284892592575c4b75fb0be333.tar.gz |
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
-rw-r--r-- | src/lib/eo/eo.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 18190cddef..3d1e7dd24a 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -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; + } } } } |