summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-24 14:39:10 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-24 20:41:19 +0100
commitf80cfa4893e1164284892592575c4b75fb0be333 (patch)
tree5cf1dac97fdb35e3aa7572a7c303ad3c40fdf3a4
parent9738a759392d1c78ed469bbed40139a6c6d12a64 (diff)
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.c11
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)
175{ 175{
176 const _Efl_Class **mro_itr = klass->mro; 176 const _Efl_Class **mro_itr = klass->mro;
177 const Eo_Vtable *vtable = &klass->vtable; 177 const Eo_Vtable *vtable = &klass->vtable;
178
179 for ( ; *mro_itr ; mro_itr++) 178 for ( ; *mro_itr ; mro_itr++)
180 { 179 {
181 const Eo_Vtable *mro_vtable = &(*mro_itr)->vtable; 180 const Eo_Vtable *mro_vtable = &(*mro_itr)->vtable;
182 if ((*mro_itr) == klass) 181 if ((*mro_itr) == klass)
183 continue; 182 continue;
184 for (int i = 0; i < mro_vtable->size; ++i) 183 for (unsigned int i = 0; i < mro_vtable->size; ++i)
185 { 184 {
186 if (mro_vtable->chain[i].funcs == vtable->chain[i].funcs) 185 if (i == klass->class_id)
187 vtable->chain[i].funcs = NULL; 186 continue;
187 if (vtable->chain[i].funcs && mro_vtable->chain[i].funcs == vtable->chain[i].funcs)
188 {
189 vtable->chain[i].funcs = NULL;
190 }
188 } 191 }
189 } 192 }
190} 193}