mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3d1afbbda3
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