Skip to content

Commit

Permalink
Fabric: Calling UIManager's uninstall function asynchonously
Browse files Browse the repository at this point in the history
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
  • Loading branch information
shergin authored and facebook-github-bot committed Oct 8, 2018
1 parent 5f4aa6a commit 0f683bb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ReactCommon/fabric/uimanager/FabricUIManager.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit 0f683bb

Please sign in to comment.