]> git.llucax.com Git - software/dgc/cdgc.git/commitdiff
Don't leak weak pointers master
authorLeandro Lucarella <llucax@gmail.com>
Tue, 19 Jul 2011 02:02:25 +0000 (23:02 -0300)
committerLeandro Lucarella <llucax@gmail.com>
Tue, 19 Jul 2011 02:02:25 +0000 (23:02 -0300)
The free() call after the return is never executed, so we have to move it
inside the locked() block of code.

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);
     }
 }