ecere/com/Containers/CustomAVLTree: Fixed key class confusion caused by a47aec0a06c2c...
authorJerome St-Louis <jerome@ecere.com>
Fri, 29 Jul 2016 06:47:03 +0000 (02:47 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 29 Jul 2016 06:47:03 +0000 (02:47 -0400)
- NOTE: We may still need a compiler fix on 'delete' operator to use proper template arg (KT rather than BT)

ecere/src/com/containers/CustomAVLTree.ec

index 96fedd3..0dd34be 100644 (file)
@@ -587,7 +587,12 @@ public:
          ((void (*)(void *, void *))(void *)Tclass._vTbl[__ecereVMethodID_class_OnFree])(Tclass, (((byte *)&item.key) + __ENDIAN_PAD(sizeof(void *))));
       }
       else
-         delete item.key;
+      {
+         // TOFIX: delete key; // This indexes the wrong templateArg (BT instead of KT)
+         KT k = item.key;
+         delete k;
+         item.key = (KT)0;
+      }
    }
 
    void Free()