mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-22 07:43:15 +00:00
Free allowed/usage class reference
This commit is contained in:
parent
bb9a99d2cd
commit
bba0a4df5e
1 changed files with 10 additions and 0 deletions
|
@ -57,15 +57,19 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
|||
|
||||
const char *packet = "eu/faircode/netguard/Packet";
|
||||
clsPacket = jniGlobalRef(env, jniFindClass(env, packet));
|
||||
ng_add_alloc(clsPacket, "clsPacket");
|
||||
|
||||
const char *allowed = "eu/faircode/netguard/Allowed";
|
||||
clsAllowed = jniGlobalRef(env, jniFindClass(env, allowed));
|
||||
ng_add_alloc(clsAllowed, "clsAllowed");
|
||||
|
||||
const char *rr = "eu/faircode/netguard/ResourceRecord";
|
||||
clsRR = jniGlobalRef(env, jniFindClass(env, rr));
|
||||
ng_add_alloc(clsRR, "clsRR");
|
||||
|
||||
const char *usage = "eu/faircode/netguard/Usage";
|
||||
clsUsage = jniGlobalRef(env, jniFindClass(env, usage));
|
||||
ng_add_alloc(clsUsage, "clsUsage");
|
||||
|
||||
// Raise file number limit to maximum
|
||||
struct rlimit rlim;
|
||||
|
@ -91,7 +95,13 @@ void JNI_OnUnload(JavaVM *vm, void *reserved) {
|
|||
log_android(ANDROID_LOG_INFO, "JNI load GetEnv failed");
|
||||
else {
|
||||
(*env)->DeleteGlobalRef(env, clsPacket);
|
||||
(*env)->DeleteGlobalRef(env, clsAllowed);
|
||||
(*env)->DeleteGlobalRef(env, clsRR);
|
||||
(*env)->DeleteGlobalRef(env, clsUsage);
|
||||
ng_delete_alloc(clsPacket, __FILE__, __LINE__);
|
||||
ng_delete_alloc(clsAllowed, __FILE__, __LINE__);
|
||||
ng_delete_alloc(clsRR, __FILE__, __LINE__);
|
||||
ng_delete_alloc(clsUsage, __FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue