bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f80cfa4893e1164284892592575c4b75fb0be333

commit f80cfa4893e1164284892592575c4b75fb0be333
Author: Marcel Hollerbach <[email protected]>
Date:   Tue Mar 24 14:39:10 2020 +0100

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11574
---
 src/lib/eo/eo.c | 11 +++++++----
 1 file 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;
+               }
           }
      }
 }

-- 


Reply via email to