diff --git a/Leaks/AsyncTask/app/build.gradle b/Leaks/AsyncTask/app/build.gradle index 958eb0c99..7e152b9ed 100644 --- a/Leaks/AsyncTask/app/build.gradle +++ b/Leaks/AsyncTask/app/build.gradle @@ -1,9 +1,9 @@ apply plugin: 'com.android.application' dependencies { - implementation 'com.android.support:support-fragment:27.1.0' - debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4' - releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' + implementation 'com.android.support:support-fragment:27.1.1' + debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.1' + releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1' } android { diff --git a/Leaks/AsyncTask/app/src/main/java/com/commonsware/android/async/CanaryApplication.java b/Leaks/AsyncTask/app/src/main/java/com/commonsware/android/async/CanaryApplication.java index 95acbce07..df6fc16f4 100644 --- a/Leaks/AsyncTask/app/src/main/java/com/commonsware/android/async/CanaryApplication.java +++ b/Leaks/AsyncTask/app/src/main/java/com/commonsware/android/async/CanaryApplication.java @@ -22,6 +22,13 @@ public class CanaryApplication extends Application { public void onCreate() { super.onCreate(); + if (LeakCanary.isInAnalyzerProcess(this)) { + // LeakCanary is processing a heap dump here; please do not disturb! + return; + } + LeakCanary.install(this); + + // do your normal initialization work here } }