Bug 749788 - Fix some JNI code bugs. r=blassey
This commit is contained in:
@@ -746,7 +746,11 @@ AndroidGeckoSurfaceView::GetSurface()
|
||||
jobject
|
||||
AndroidGeckoSurfaceView::GetSurfaceHolder()
|
||||
{
|
||||
return GetJNIForThread()->CallObjectMethod(wrapped_obj, jGetHolderMethod);
|
||||
JNIEnv *env = GetJNIForThread();
|
||||
if (!env)
|
||||
return nsnull;
|
||||
|
||||
return env->CallObjectMethod(wrapped_obj, jGetHolderMethod);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -886,8 +890,13 @@ nsJNIString::nsJNIString(jstring jstr, JNIEnv *jenv)
|
||||
return;
|
||||
}
|
||||
JNIEnv *jni = jenv;
|
||||
if (!jni)
|
||||
if (!jni) {
|
||||
jni = AndroidBridge::GetJNIEnv();
|
||||
if (!jni) {
|
||||
SetIsVoid(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const jchar* jCharPtr = jni->GetStringChars(jstr, NULL);
|
||||
|
||||
if (!jCharPtr) {
|
||||
|
||||
Reference in New Issue
Block a user