fix #302, add a toggle for disabling leak canary

This commit is contained in:
tibbi 2017-07-09 09:28:26 +02:00
parent 16391bce10
commit 3df76261e0
1 changed files with 6 additions and 3 deletions

View File

@ -4,11 +4,14 @@ import android.app.Application
import com.squareup.leakcanary.LeakCanary import com.squareup.leakcanary.LeakCanary
class App : Application() { class App : Application() {
val USE_LEAK_CANARY = false
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
if (USE_LEAK_CANARY) {
if (LeakCanary.isInAnalyzerProcess(this)) { if (LeakCanary.isInAnalyzerProcess(this)) {
return return
} }
LeakCanary.install(this) LeakCanary.install(this)
} }
}
} }