Fabric: Calling UIManager's uninstall function asynchonously

Summary:
Calling `uninstall` synchnously was a bad idea. Unfortunatelly, even if it illuminate possible race condition during uninstallation, sometimes it deadlock.
It's not clear for now how to solve both problems without introducting another layer of indirection between UIManager and JSI.

Reviewed By: mdvacca

Differential Revision: D10081500

fbshipit-source-id: 90d8120603929a8219a3e606d8b3527e297b13ce
This commit is contained in:
Valentin Shergin
2018-10-08 14:34:27 -07:00
committed by Facebook Github Bot
parent 5f4aa6ae42
commit 0f683bb5c1

View File

@@ -106,11 +106,9 @@ FabricUIManager::~FabricUIManager() {
auto executor = std::shared_ptr<EventBeatBasedExecutor> {std::move(executor_)};
auto uninstaller = std::move(uninstaller_);
// We have to call this synchronously to postpose UIManager deallocation
// until it is fully uninstalled and JavaScript cannot access this anymore.
(*executor)([uninstaller, executor]() {
uninstaller();
}, EventBeatBasedExecutor::Mode::Synchronous);
});
}
void FabricUIManager::setComponentDescriptorRegistry(const SharedComponentDescriptorRegistry &componentDescriptorRegistry) {