Skip to content

Commit c45c1bd

Browse files
authored
fix: stop a crash in HostObject dtor (#540)
1 parent 1601d2e commit c45c1bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cpp/JSIUtils/MGLTypedArray.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class PropNameIDCache {
5050
const jsi::PropNameID &getConstructorNameProp(jsi::Runtime &runtime,
5151
MGLTypedArrayKind kind);
5252

53-
void invalidate() { props.erase(props.begin(), props.end()); }
53+
void invalidate() {
54+
/** This call (and attempts to use props.clear()) crash 💥 when the
55+
* JSI runtime has already been destroyed. So we are commenting it out
56+
* and waiting for Nitro and 1.0 to fix this the proper way.
57+
*/
58+
//props.erase(props.begin(), props.end());
59+
}
5460

5561
private:
5662
std::unordered_map<Prop, std::unique_ptr<jsi::PropNameID>> props;

0 commit comments

Comments
 (0)