diff --git a/app/build.gradle b/app/build.gradle
index 498416210..88567c148 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -110,7 +110,7 @@ final DAGGER_VERSION = '2.16'
final BUTTERKNIFE_VERSION = '9.0.0-rc1'
final STETHO_VERSION = '1.5.0'
final WORK_VERSION = '1.0.0-alpha10'
-final LEAKCANARY_VERSION = '1.6.1'
+final LEAKCANARY_VERSION = '1.6.2'
dependencies {
implementation project(":dav4android")
diff --git a/app/src/debug/java/org/tasks/BuildSetup.java b/app/src/debug/java/org/tasks/BuildSetup.java
index c695584a7..77800ee4d 100644
--- a/app/src/debug/java/org/tasks/BuildSetup.java
+++ b/app/src/debug/java/org/tasks/BuildSetup.java
@@ -30,7 +30,9 @@ public class BuildSetup {
if (LeakCanary.isInAnalyzerProcess(context)) {
return false;
}
- LeakCanary.install(application);
+ if (preferences.getBoolean(R.string.p_leak_canary, false)) {
+ LeakCanary.install(application);
+ }
if (preferences.getBoolean(R.string.p_strict_mode, false)) {
StrictMode.setThreadPolicy(
new StrictMode.ThreadPolicy.Builder()
diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml
index 004bfbafe..0496f2dea 100644
--- a/app/src/main/res/values/keys.xml
+++ b/app/src/main/res/values/keys.xml
@@ -276,6 +276,7 @@
Consume
Strict mode
+ LeakCanary
Unlock pro
Buy
Debug
@@ -284,6 +285,7 @@
gtask_background_sync
bundle_notifications
strict_mode
+ leak_canary
debug_pro
warned_play_services
background_sync_unmetered_only
diff --git a/app/src/main/res/xml/preferences_debug.xml b/app/src/main/res/xml/preferences_debug.xml
index 37da7988c..f0394ddfa 100644
--- a/app/src/main/res/xml/preferences_debug.xml
+++ b/app/src/main/res/xml/preferences_debug.xml
@@ -4,6 +4,10 @@
+
+