fix #302, add a toggle for disabling leak canary
This commit is contained in:
parent
16391bce10
commit
3df76261e0
1 changed files with 6 additions and 3 deletions
|
@ -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 (USE_LEAK_CANARY) {
|
||||
if (LeakCanary.isInAnalyzerProcess(this)) {
|
||||
return
|
||||
}
|
||||
LeakCanary.install(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue