From d485e41e8edd249295e8500ec37c674699ad2c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Thu, 20 Aug 2020 19:05:55 +0200 Subject: [PATCH] Make RCTCxxBridgeDelegate not care about return value of jsExecutorFactoryForBridge --- React/CxxBridge/RCTCxxBridge.mm | 2 +- React/CxxBridge/RCTCxxBridgeDelegate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index d8938d7033a24e..a9bea58741a7a0 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -336,7 +336,7 @@ - (void)start if (!self.executorClass) { if ([self.delegate conformsToProtocol:@protocol(RCTCxxBridgeDelegate)]) { id cxxDelegate = (id)self.delegate; - executorFactory = [cxxDelegate jsExecutorFactoryForBridge:self]; + executorFactory = std::make_shared(*reinterpret_cast([cxxDelegate jsExecutorFactoryForBridge:self])); } if (!executorFactory) { executorFactory = std::make_shared(nullptr); diff --git a/React/CxxBridge/RCTCxxBridgeDelegate.h b/React/CxxBridge/RCTCxxBridgeDelegate.h index c574eee4fe5cdf..8e19f3f4208302 100644 --- a/React/CxxBridge/RCTCxxBridgeDelegate.h +++ b/React/CxxBridge/RCTCxxBridgeDelegate.h @@ -28,6 +28,6 @@ class JSExecutorFactory; * If not implemented, or returns an empty pointer, JSIExecutorFactory * will be used with a JSCRuntime. */ -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge; +- (void *)jsExecutorFactoryForBridge:(RCTBridge *)bridge; @end