mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 17:37:34 +08:00
Use an atomic bool to track bridge destruction
Summary: We're seeing intermittent crashes in ~Bridge() where m_destroyed isn't set. This could be because the value of m_destroyed is cached for the destructing thread and doesn't see that the value got updated. Using an atomic boolean should fix this. Reviewed By: mhorowitz Differential Revision: D3126701 fb-gh-sync-id: 5887edef748cc05971765943de80187ab7fd8ede fbshipit-source-id: 5887edef748cc05971765943de80187ab7fd8ede
This commit is contained in:
committed by
Facebook Github Bot 7
parent
e8e8e8acdc
commit
c0108a269d
@@ -406,6 +406,12 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
Assertions.assertCondition(mDestroyed, "Bridge was not destroyed before finalizer!");
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
private class NativeModulesReactCallback implements ReactCallback {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user