Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve onMainLoopIdle stability #146

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions android/src/main/cpp/OnLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ class V8ExecutorHolder
jni::alias_ref<facebook::react::JRuntimeExecutor::javaobject>
runtimeExecutor) {
runtimeExecutor->cthis()->get()([](jsi::Runtime &runtime) {
auto &v8Runtime = reinterpret_cast<V8Runtime &>(runtime);
v8Runtime.OnMainLoopIdle();
auto v8Runtime = dynamic_cast<V8Runtime *>(&runtime);
if (v8Runtime) {
v8Runtime->OnMainLoopIdle();
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public V8Module(ReactApplicationContext reactContext) {

@Override
public void onCatalystInstanceDestroy() {
super.onCatalystInstanceDestroy();
unregisterMainIdleHandler();
super.onCatalystInstanceDestroy();
}

@Override
Expand Down