Fixed QJNIEnvironment reference counting.
Change-Id: I02369e0c6472375efeffed577d39b764c591e025 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
parent
0b1e30aee4
commit
445efa40a2
@ -160,10 +160,12 @@ QJNIEnvironmentPrivate::QJNIEnvironmentPrivate()
|
||||
: jniEnv(0)
|
||||
{
|
||||
JavaVM *vm = QtAndroidPrivate::javaVM();
|
||||
if (vm->GetEnv((void**)&jniEnv, JNI_VERSION_1_6) != JNI_EDETACHED)
|
||||
return;
|
||||
if (vm->GetEnv((void**)&jniEnv, JNI_VERSION_1_6) == JNI_EDETACHED) {
|
||||
if (vm->AttachCurrentThread(&jniEnv, 0) < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
if (vm->AttachCurrentThread(&jniEnv, 0) < 0)
|
||||
if (!jniEnv)
|
||||
return;
|
||||
|
||||
if (!refCount->hasLocalData())
|
||||
|
Loading…
Reference in New Issue
Block a user