Index: src/wasm/managed.h |
diff --git a/src/wasm/managed.h b/src/wasm/managed.h |
index 09ddf60aaa6506d73ac59c20727d613a691b98d6..785d5d32c0ac314349d8f0b5a1ad2ed318a78d06 100644 |
--- a/src/wasm/managed.h |
+++ b/src/wasm/managed.h |
@@ -46,6 +46,7 @@ class Managed : public Foreign { |
Managed<CppType>** p = |
reinterpret_cast<Managed<CppType>**>(data.GetParameter()); |
delete (*p)->get(); |
+ (*p)->set_foreign_address(0); |
GlobalHandles::Destroy(reinterpret_cast<Object**>(p)); |
} |
}; |