Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] Remove invoke to DeleteGlobalRef to avoid client crash
Browse files Browse the repository at this point in the history
See #4121
  • Loading branch information
zugaldia committed Feb 26, 2016
1 parent 01e55f1 commit 11d3eff
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions platform/android/src/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1940,8 +1940,7 @@ void JNICALL setOfflineRegionObserver(JNIEnv *env, jobject obj, jobject offlineR
env2->SetBooleanField(jstatus, offlineRegionStatusRequiredResourceCountIsPreciseId, status.requiredResourceCountIsPrecise);
env2->CallVoidMethod(observerCallback, offlineRegionObserveronStatusChangedId, jstatus);

// Delete global refs and detach when we're done
env2->DeleteGlobalRef(observerCallback);
// Detach when we're done
detach_jni_thread(theJVM, &env2, renderDetach);
}

Expand Down Expand Up @@ -1976,8 +1975,7 @@ void JNICALL setOfflineRegionObserver(JNIEnv *env, jobject obj, jobject offlineR
env2->SetObjectField(jerror, offlineRegionErrorMessageId, std_string_to_jstring(env2, error.message));
env2->CallVoidMethod(observerCallback, offlineRegionObserveronErrorId, jerror);

// Delete global refs and detach when we're done
env2->DeleteGlobalRef(observerCallback);
// Detach when we're done
detach_jni_thread(theJVM, &env2, renderDetach);
}

Expand All @@ -1989,8 +1987,7 @@ void JNICALL setOfflineRegionObserver(JNIEnv *env, jobject obj, jobject offlineR
// Send limit
env2->CallVoidMethod(observerCallback, offlineRegionObserveronLimitId, limit);

// Delete global refs and detach when we're done
env2->DeleteGlobalRef(observerCallback);
// Detach when we're done
detach_jni_thread(theJVM, &env2, renderDetach);
}

Expand Down

0 comments on commit 11d3eff

Please sign in to comment.