ecere/MemoryGuard: Added check in eInstance_Delete to prevent crash and see MemoryGua...
authorJerome St-Louis <jerome@ecere.com>
Sat, 15 Oct 2011 19:53:03 +0000 (15:53 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sat, 15 Oct 2011 19:53:03 +0000 (15:53 -0400)
ecere/src/com/instance.ec

index c3ffee3..8c86d1b 100644 (file)
@@ -4314,7 +4314,14 @@ public dllexport void eInstance_Delete(Instance instance)
    if(instance)
    {
       Class _class, base;
-      bool ownVtbl = instance._vTbl != instance._class._vTbl;
+      bool ownVtbl;
+
+#ifdef MEMINFO
+      if(instance._class == 0xecececec)
+         _free(instance);
+#endif
+
+      ownVtbl = instance._vTbl != instance._class._vTbl;
 
       for(_class = instance._class; _class; _class = base)
       {