about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-01-06 17:46:33 -0800
committerNiko Matsakis <niko@alum.mit.edu>2012-01-06 22:40:32 -0800
commit6237368cc2e640e50ee3616386be65e7f0fc98ad (patch)
tree9446f6db388b9067dd8923f1b62a5cf735ce8893 /src/rt/rust_upcall.cpp
parentd1b987d292cc0f4fa412d18b051ce8681256bb61 (diff)
downloadrust-6237368cc2e640e50ee3616386be65e7f0fc98ad.tar.gz
rust-6237368cc2e640e50ee3616386be65e7f0fc98ad.zip
plug leak: free shared type descrs recursively, as we ought to
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index a520770be3a..2b104548f90 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -293,7 +293,9 @@ void upcall_s_free_shared_type_desc(type_desc *td)
 
 extern "C" CDECL void
 upcall_free_shared_type_desc(type_desc *td) {
-    UPCALL_SWITCH_STACK(td, upcall_s_free_shared_type_desc);
+    if (td) {
+        UPCALL_SWITCH_STACK(td, upcall_s_free_shared_type_desc);
+    }
 }
 
 /**********************************************************************