From 0b29f27be484889b089580a154d392d57200dddf Mon Sep 17 00:00:00 2001 From: PeratX <1215714524@qq.com> Date: Tue, 11 Apr 2017 12:23:42 +0800 Subject: [PATCH] Fixed probable memory leak in ServerTestActivity --- .../itxtech/daedalus/activity/ServerTestActivity.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/org/itxtech/daedalus/activity/ServerTestActivity.java b/app/src/main/java/org/itxtech/daedalus/activity/ServerTestActivity.java index c25914d..c7cfeaf 100644 --- a/app/src/main/java/org/itxtech/daedalus/activity/ServerTestActivity.java +++ b/app/src/main/java/org/itxtech/daedalus/activity/ServerTestActivity.java @@ -140,6 +140,17 @@ public class ServerTestActivity extends AppCompatActivity { mHandler.setViews(startTestBut, textViewTestInfo); } + @Override + protected void onDestroy() { + super.onDestroy(); + + if (mThread != null) { + mThread.interrupt(); + mThread = null; + } + mHandler = null; + } + public static class ServerTestHandler extends Handler { private Button startTestBtn = null; private TextView textViewTestInfo = null;