react-native-macos/ReactCommon
Ramanpreet Nara fc9c53d621 Refactor Promise returns
Summary:
Because we use the `PromiseWrapper` struct, we need to explicitly manage its lifecycle to ensure that it doesn't clear before the promise methods are invoked by the ObjC Runtime. This `PromiseWrapper` struct is unnecessary. We could just not have it and create the CallbackWrappers for resolve and reject within the `createPromise` function. Therefore, I moved all the logic from `PromiseWrapper` to the `RCTTurboModule::createPromise` function.

In the next diff, I'm going to keep a track of all the CallbackWrappers we create in instances of RCTTurboModule, and `destroy()` them in the destructor of RCTTurboModule. This should make sure that all `jsi::Function`s are released before we delete the `jsi::Runtime`, which should prevent Marketplace from crashing when we hit CMD + R. See: https://fb.workplace.com/groups/rn.support/permalink/2761112713937326/.

Reviewed By: fkgozali

Differential Revision: D17208729

fbshipit-source-id: ce80c9c01088f0e3dc47c7c29397b7a197d699ce
2019-09-11 14:58:17 -07:00
..
better Fabric: Enable CXX (aka Default) platfrom fravour for all C++ Fabric targets 2019-06-04 15:34:34 -07:00
config Fabric: Enable CXX (aka Default) platfrom fravour for all C++ Fabric targets 2019-06-04 15:34:34 -07:00
cxxreact fixing ATOMIC_VAR_INIT call (#26238) 2019-09-09 07:55:25 -07:00
fabric Remove cxx from iOS project (#25392) 2019-09-10 13:40:42 -07:00
hermes/inspector Fix compile error for native debug build (#26248) 2019-09-03 18:27:55 -07:00
jscallinvoker TM iOS: move jscallinvoker under ReactCommon podspec 2019-07-12 22:44:20 -07:00
jsi Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp (#25884) 2019-08-20 17:14:01 -07:00
jsiexecutor Remove 's.static_framework = true' requirement for podspec (#25816) 2019-07-25 11:46:43 -07:00
jsinspector Remove 's.static_framework = true' requirement for podspec (#25816) 2019-07-25 11:46:43 -07:00
microprofiler Upgrade mobile BUCK and .bzl files to use C++14 2019-03-16 02:25:33 -07:00
turbomodule Refactor Promise returns 2019-09-11 14:58:17 -07:00
utils Fabric: Fixing "No suitable image loader" redbox on hot-reload 2019-09-03 16:49:54 -07:00
yoga Rename yoga.podspec to Yoga.podspec (#26360) 2019-09-11 04:12:17 -07:00
React-Fabric.podspec Remove cxx from iOS project (#25392) 2019-09-10 13:40:42 -07:00
ReactCommon.podspec Fix typos in comments about use_frameworks! (#26381) 2019-09-09 07:23:59 -07:00