优化部分代码

This commit is contained in:
TonyJiangWJ 2020-12-26 12:19:12 +08:00
parent 1a2612ba86
commit 8efb74eae0
3 changed files with 6 additions and 1 deletions

View File

@ -424,6 +424,7 @@ public class ScriptRuntime {
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
ignoresException(images::releaseScreenCapturer);
ignoresException(images::recycle);
}
ignoresException(sensors::unregisterAll);
ignoresException(timers::recycle);

View File

@ -267,7 +267,6 @@ public class Images {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mScreenCapturer != null) {
mScreenCapturer.release();
}
mScriptRuntime = null;
}
public Point findImage(ImageWrapper image, ImageWrapper template) {
@ -366,4 +365,8 @@ public class Images {
}
}
public void recycle() {
mScriptRuntime = null;
}
}

View File

@ -1,3 +1,4 @@
include ':app', ':automator', ':common', ':autojs', ':inrt', ':autojs-tool-color-center'
include ':autojs-tool-download'
include ':autojs-tool-webview'
include ':autojs-tool-encrypt'