Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,13 @@ public void onReactInstanceDestroyed(ReactContext reactContext) {
// for this manager
resetCurrentContext(null);
}

// If some JNI types (e.g. jni::HybridClass) are used in JSI (e.g. jsi::HostObject), they might
// not be immediately deleted on an app refresh as both Java and JavaScript are
// garbage-collected languages and the memory might float around for a while.
// For C++ developers, this will be hard to debug as destructors might be called at a later point,
// so in this case we trigger a Java GC to maybe eagerly collect such objects when the app reloads.
System.gc();
}

@Override
Expand Down