mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
TM Android: fixed up JSCallInvoker creation
Summary: A previous commit changed the signature of the Instance (the arg to JSCallInvoker) to be a weak ref, so this callsite needs updating. Reviewed By: mmmulani Differential Revision: D14757188 fbshipit-source-id: 1a8663e56a42b26c6202881c57a7caafa71da2ab
This commit is contained in:
committed by
Facebook Github Bot
parent
99ec3dc845
commit
1e2e07da2c
@@ -33,6 +33,7 @@ rn_xplat_cxx_library(
|
||||
],
|
||||
exported_deps = [
|
||||
"fbsource//xplat/jsi:jsi",
|
||||
react_native_xplat_target("cxxreact:bridge"),
|
||||
react_native_xplat_target("turbomodule/core:core"),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <fb/fbjni.h>
|
||||
#include <jsi/jsi.h>
|
||||
|
||||
#include <cxxreact/Instance.h>
|
||||
#include <jsireact/TurboModuleBinding.h>
|
||||
|
||||
#include <react/jni/JMessageQueueThread.h>
|
||||
@@ -56,7 +57,9 @@ void TurboModuleManager::installJSIBindings() {
|
||||
[this](const std::string &name) {
|
||||
const auto moduleInstance = getJavaModule(name);
|
||||
// TODO: Pass in react Instance to JSCallInvoker instead.
|
||||
const auto jsInvoker = std::make_shared<react::JSCallInvoker>(nullptr);
|
||||
std::shared_ptr<Instance> instance = nullptr;
|
||||
std::weak_ptr<Instance> weakInstance = instance;
|
||||
const auto jsInvoker = std::make_shared<react::JSCallInvoker>(weakInstance);
|
||||
return moduleProvider_(name, moduleInstance, jsInvoker);
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user