mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
destroy callbacks even if they aren't called, when java object is destroyed
Summary: JSI callbacks are only destroyed if the callback is called. If the callback is never called, we're potentially leaking a lot of callbacks. To mitigate this, we add a wrapper object that is owned by the std::function. Whenever the std::function is destroyed, the wrapper is destroyed and it deallocates the callback as well. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D27436402 fbshipit-source-id: d153640d5d7988c7fadaf2cb332ec00dadd0689a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0901830977
commit
3d1afbbda3
@@ -23,6 +23,13 @@ public class ReactFeatureFlags {
|
||||
*/
|
||||
public static volatile boolean useTurboModules = false;
|
||||
|
||||
/**
|
||||
* Should application use the new TM callback manager in Cxx? This is assumed to be a sane
|
||||
* default, but it's new. We will delete once (1) we know it's safe to ship and (2) we have
|
||||
* quantified impact.
|
||||
*/
|
||||
public static volatile boolean useTurboModulesRAIICallbackManager = false;
|
||||
|
||||
/** Should we dispatch TurboModule methods with promise returns to the NativeModules thread? */
|
||||
public static volatile boolean enableTurboModulePromiseAsyncDispatch = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user