Clear internal maps of NativeModuleRegistry during turn down of the bridge

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
This commit is contained in:
David Vacca
2021-02-06 23:05:28 -08:00
committed by Facebook GitHub Bot
parent 1e8c3e4ad8
commit 98165a23f6
2 changed files with 2 additions and 0 deletions
@@ -44,5 +44,6 @@ public class JSIModuleRegistry {
JSIModuleHolder moduleHolder = entry.getValue();
moduleHolder.notifyJSInstanceDestroy();
}
mModules.clear();
}
}
@@ -84,6 +84,7 @@ public class NativeModuleRegistry {
for (ModuleHolder module : mModules.values()) {
module.destroy();
}
mModules.clear();
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}