Merge pull request #134 from C3C0/master

Perform explicit garbage collection before every backupAndHook
This commit is contained in:
solohsu 2019-03-06 17:41:42 +08:00 committed by GitHub
commit 93cea40f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -111,6 +111,7 @@ public class HookMain {
if (backup != null) {
HookMethodResolver.resolveMethod(hook, backup);
}
Runtime.getRuntime().gc();
if (!backupAndHookNative(target, hook, backup)) {
throw new RuntimeException("Failed to hook " + target + " with " + hook);
}