From dffb61dcbbd85a8a4ea0a79e0d90dd73a54c5379 Mon Sep 17 00:00:00 2001 From: Neil Dhar Date: Tue, 6 Oct 2020 17:30:49 -0700 Subject: [PATCH] Remove capture of instance_ Summary: The captured `instance_` will result in a call to JVM code to release the reference when the lambda is destroyed. However, Hermes may destroy the lambda in a non-JVM background thread. Since `instance_` is a member of the class, and `this` is already captured, there is no need to capture it. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D24141179 fbshipit-source-id: e3b268485ed229ee933281a80e5dbe2feba55719 --- .../core/platform/android/ReactCommon/JavaTurboModule.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp b/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp index 82fbc928fb6..f4b3f967e91 100644 --- a/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +++ b/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp @@ -733,7 +733,6 @@ jsi::Value JavaTurboModule::invokeJavaMethod( &jargs, &globalRefs, argCount, - instance_ = instance_, methodID, moduleNameStr = name_, methodNameStr,