avoid coredump on C<sort { my $c; return $a cmp $b } ...>
[p5sagit/p5-mst-13.2.git] / globals.c
index fc88f31..9777273 100644 (file)
--- a/globals.c
+++ b/globals.c
@@ -35,13 +35,20 @@ CPerlObj::CPerlObj(IPerlMem* ipM, IPerlEnv* ipE, IPerlStdIO* ipStd,
 void*
 CPerlObj::operator new(size_t nSize, IPerlMem *pvtbl)
 {
-    if(pvtbl != NULL)
+    if(pvtbl)
        return pvtbl->pMalloc(pvtbl, nSize);
 
     return NULL;
 }
 
 void
+CPerlObj::operator delete(void *pPerl, IPerlMem *pvtbl)
+{
+    if(pvtbl)
+       pvtbl->pFree(pvtbl, pPerl);
+}
+
+void
 CPerlObj::Init(void)
 {
 }