mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1237009 - avoid extra AddRef/Release in Android NativeZip JNI code; r=darchons
We don't need to take an extra ref when we're just going to release the one we already have. Just return our ref directly.
This commit is contained in:
parent
c85b24c6f8
commit
1e783350c8
@ -68,8 +68,7 @@ Java_org_mozilla_gecko_mozglue_NativeZip_getZip(JNIEnv *jenv, jclass, jstring pa
|
||||
JNI_Throw(jenv, "java/lang/IllegalArgumentException", "Invalid path or invalid zip");
|
||||
return 0;
|
||||
}
|
||||
zip->AddRef();
|
||||
return (jlong) zip.get();
|
||||
return reinterpret_cast<jlong>(zip.forget().take());
|
||||
}
|
||||
|
||||
extern "C"
|
||||
@ -84,8 +83,7 @@ Java_org_mozilla_gecko_mozglue_NativeZip_getZipFromByteBuffer(JNIEnv *jenv, jcla
|
||||
JNI_Throw(jenv, "java/lang/IllegalArgumentException", "Invalid zip");
|
||||
return 0;
|
||||
}
|
||||
zip->AddRef();
|
||||
return (jlong) zip.get();
|
||||
return reinterpret_cast<jlong>(zip.forget().take());
|
||||
}
|
||||
|
||||
extern "C"
|
||||
|
Loading…
Reference in New Issue
Block a user