TM iOS: avoid bad memory access when passing prop name to a lambda

Summary: Depending on the timing of the method call from JS to a CxxModule, we may be accessing memory that has been deallocated, causing exception to RN runtime. This fixes it.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D14033831

fbshipit-source-id: 5a77aa41223b1fc3146dcf78b7f8e93375605d6d
This commit is contained in:
Kevin Gozali 2019-02-11 17:25:33 -08:00 committed by Facebook Github Bot
parent 2c09c06a4d
commit 344b32bb64
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ jsi::Value TurboCxxModule::get(jsi::Runtime& runtime, const jsi::PropNameID& pro
runtime,
propName,
0,
[this, &propNameUtf8](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) {
[this, propNameUtf8](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) {
return invokeMethod(rt, VoidKind, propNameUtf8, args, count);
});
}