Skip to content

Commit

Permalink
Clear internal maps of NativeModuleRegistry during turn down of the b…
Browse files Browse the repository at this point in the history
…ridge

Summary:
This diff clears the internal maps of NativeModuleRegistry during turn down of the bridge.

This is necessary for a proper cleanup of these modules.

changelog: [internal] internal

Reviewed By: ShikaSD

Differential Revision: D26239303

fbshipit-source-id: 6e98e5db60a4f54d02e99b03339b03c17ecc183d
  • Loading branch information
mdvacca authored and facebook-github-bot committed Feb 7, 2021
1 parent 1e8c3e4 commit 98165a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ public void notifyJSInstanceDestroy() {
JSIModuleHolder moduleHolder = entry.getValue();
moduleHolder.notifyJSInstanceDestroy();
}
mModules.clear();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private ReactApplicationContext getReactApplicationContext() {
for (ModuleHolder module : mModules.values()) {
module.destroy();
}
mModules.clear();
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}
Expand Down

0 comments on commit 98165a2

Please sign in to comment.