]> git.llucax.com Git - software/dgc/cdgc.git/blobdiff - rt/gc/cdgc/gc.d
Don't leak weak pointers
[software/dgc/cdgc.git] / rt / gc / cdgc / gc.d
index e6b3c11c8b330963329571de190f844711adf466..98e5899fcf3e41ad1cd5c4b4abf37642d9cdee9c 100644 (file)
@@ -1981,8 +1981,8 @@ void weakpointerDestroy( void* p )
         return locked!(void, () {
             if (wp.reference)
                 rt_detachDisposeEvent(wp.reference, &wp.ondestroy);
+            cstdlib.free(wp);
         })();
-        cstdlib.free(wp);
     }
 }