Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Fix crash on resume in RunnableQueue #1490

Merged
merged 1 commit into from
Aug 2, 2019
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
11 changes: 8 additions & 3 deletions app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ android_main(android_app *aAppState) {

// Attach JNI thread
JNIEnv *jniEnv;
(*aAppState->activity->vm).AttachCurrentThread(&jniEnv, NULL);
(*aAppState->activity->vm).AttachCurrentThread(&jniEnv, nullptr);
sAppContext->mQueue->InitializeJava(jniEnv);

// Create Browser context
crow::VRBrowser::InitializeJava(jniEnv, aAppState->activity->clazz);
Expand Down Expand Up @@ -228,22 +229,26 @@ android_main(android_app *aAppState) {
// Loop until all events are read
// If the activity is paused use a blocking call to read events.
while (ALooper_pollAll(BrowserWorld::Instance().IsPaused() ? -1 : 0,
NULL,
nullptr,
&events,
(void **) &pSource) >= 0) {
// Process event.
if (pSource) {
pSource->process(aAppState, pSource);
}



// Check if we are exiting.
if (aAppState->destroyRequested != 0) {
sAppContext->mEgl->MakeCurrent();
sAppContext->mQueue->ProcessRunnables();
BrowserWorld::Instance().ShutdownGL();
BrowserWorld::Instance().ShutdownJava();
BrowserWorld::Destroy();
sAppContext->mEgl->Destroy();
sAppContext.reset();
sAppContext->mEgl.reset();
sAppContext->mDevice.reset();
aAppState->activity->vm->DetachCurrentThread();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/vrb