mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14222 from TheCodez/fix_memoryleak
Fix memory leak in Enhance-API
This commit is contained in:
commit
d2d60e36d2
|
@ -52,6 +52,7 @@ int EnhanceAPI::setResolutionPercent(int n)
|
||||||
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setResolutionPercent", "(I)I"))
|
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setResolutionPercent", "(I)I"))
|
||||||
{
|
{
|
||||||
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, n);
|
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, n);
|
||||||
|
t.env->DeleteLocalRef(t.classID);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -63,6 +64,7 @@ int EnhanceAPI::setFPS(int fps)
|
||||||
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setFPS", "(I)I"))
|
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setFPS", "(I)I"))
|
||||||
{
|
{
|
||||||
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, fps);
|
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, fps);
|
||||||
|
t.env->DeleteLocalRef(t.classID);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -74,6 +76,7 @@ int EnhanceAPI::fastLoading(int sec)
|
||||||
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "fastLoading", "(I)I"))
|
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "fastLoading", "(I)I"))
|
||||||
{
|
{
|
||||||
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, sec);
|
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, sec);
|
||||||
|
t.env->DeleteLocalRef(t.classID);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +88,7 @@ int EnhanceAPI::getTemperature()
|
||||||
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "getTemperature", "()I"))
|
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "getTemperature", "()I"))
|
||||||
{
|
{
|
||||||
ret = t.env->CallStaticIntMethod(t.classID, t.methodID);
|
ret = t.env->CallStaticIntMethod(t.classID, t.methodID);
|
||||||
|
t.env->DeleteLocalRef(t.classID);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -96,6 +100,7 @@ int EnhanceAPI::setLowPowerMode(bool enable)
|
||||||
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setLowPowerMode", "(Z)I"))
|
if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setLowPowerMode", "(Z)I"))
|
||||||
{
|
{
|
||||||
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, enable);
|
ret = t.env->CallStaticIntMethod(t.classID, t.methodID, enable);
|
||||||
|
t.env->DeleteLocalRef(t.classID);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue