mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 790198 - Cleanup local JNI references in Android plugins r=snorp
This commit is contained in:
parent
1022a255d2
commit
71db9bf014
@ -58,6 +58,9 @@ jclass anp_system_loadJavaClass(NPP instance, const char* className)
|
||||
jstring jclassName = env->NewStringUTF(className);
|
||||
jstring jlibName = env->NewStringUTF(libName.get());
|
||||
jobject obj = env->CallStaticObjectMethod(cls, method, jclassName, jlibName);
|
||||
env->DeleteLocalRef(jlibName);
|
||||
env->DeleteLocalRef(jclassName);
|
||||
env->DeleteLocalRef(cls);
|
||||
return reinterpret_cast<jclass>(obj);
|
||||
}
|
||||
|
||||
|
@ -2223,6 +2223,7 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
|
||||
jfieldID field = env->GetStaticFieldID(cls, "mAppContext",
|
||||
"Lorg/mozilla/gecko/GeckoApp;");
|
||||
jobject ret = env->GetStaticObjectField(cls, field);
|
||||
env->DeleteLocalRef(cls);
|
||||
int32_t* i = reinterpret_cast<int32_t*>(result);
|
||||
*i = reinterpret_cast<int32_t>(ret);
|
||||
return NPERR_NO_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user