fixed bug on CkConditional using erroneous destructor
authorFilippo Gioachin <gioachin@illinois.edu>
Fri, 8 May 2009 21:44:48 +0000 (21:44 +0000)
committerFilippo Gioachin <gioachin@illinois.edu>
Fri, 8 May 2009 21:44:48 +0000 (21:44 +0000)
src/ck-core/charm++.h

index e3b9bd47c57600225d90a37bdad3e83f11a47330..7bbe199cc317f3af0f2bf4080d16a298cdc3e16d 100644 (file)
@@ -1038,11 +1038,18 @@ class CkConditional {
   int refcount;
 public:
   CkConditional() : refcount(1) { }
+  virtual ~CkConditional() { }
+    /*
   void* operator new(size_t s) {
     return malloc(s);
   }
-  void operator delete(void *p) {
-    if (--((CkConditional*)p)->refcount == 0) free(p);
+    */
+  void deallocate() {
+    CkPrintf("CkConditional::delete %d\n",refcount);
+    if (--refcount == 0) {
+      //((CkConditional*)p)->~CkConditional();
+      delete this;
+    }
   }
   void copyreference(void) {
     ++refcount;