Skip to content

Commit 6dd2cac

Browse files
sammy-SCmeta-codesync[bot]
authored andcommitted
Pass shared_ptr to lambda in ReactInstance (#56893)
Summary: Pull Request resolved: #56893 changelog: [internal] this is a sensible change to follow the pattern established in the class and avoid passing in `this` into lambda. Reviewed By: fkgozali, javache Differential Revision: D105696365 fbshipit-source-id: 0340a904cd2cc332019ba0d70cabf09e679f37b9
1 parent 2d657dc commit 6dd2cac

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void ReactInstance::loadScript(
235235
std::shared_ptr<const jsi::Buffer> buffer(std::move(script));
236236
std::string scriptName = simpleBasename(sourceURL);
237237

238-
runtimeScheduler_->scheduleWork([this,
238+
runtimeScheduler_->scheduleWork([jsErrorHandler = jsErrorHandler_,
239239
scriptName,
240240
sourceURL,
241241
buffer = std::move(buffer),
@@ -273,8 +273,8 @@ void ReactInstance::loadScript(
273273
* pipeline from javascript. Remove this after we figure that out, or
274274
* after we just remove the js pipeline.
275275
*/
276-
if (!jsErrorHandler_->hasHandledFatalError()) {
277-
jsErrorHandler_->setRuntimeReady();
276+
if (!jsErrorHandler->hasHandledFatalError()) {
277+
jsErrorHandler->setRuntimeReady();
278278
}
279279

280280
if (hasLogger) {

0 commit comments

Comments
 (0)