From 3df76261e0edd74ba6c9dd79c86ac967265ad59e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Jul 2017 09:28:26 +0200 Subject: [PATCH] fix #302, add a toggle for disabling leak canary --- app/src/main/kotlin/com/simplemobiletools/gallery/App.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt index 9e46e19a9..4cbda3237 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/App.kt @@ -4,11 +4,14 @@ import android.app.Application import com.squareup.leakcanary.LeakCanary class App : Application() { + val USE_LEAK_CANARY = false override fun onCreate() { super.onCreate() - if (LeakCanary.isInAnalyzerProcess(this)) { - return + if (USE_LEAK_CANARY) { + if (LeakCanary.isInAnalyzerProcess(this)) { + return + } + LeakCanary.install(this) } - LeakCanary.install(this) } }