add leak canary for detecting memory leaks at debug builds
This commit is contained in:
parent
c4c19f82af
commit
d914f0bb53
|
@ -40,6 +40,10 @@ dependencies {
|
|||
compile 'com.github.chrisbanes:PhotoView:1.3.1'
|
||||
compile 'it.sephiroth.android.exif:library:1.0.1'
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
|
||||
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
|
||||
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
|
||||
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
|
||||
}
|
||||
|
||||
buildscript {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
|
||||
|
||||
<application
|
||||
android:name=".App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_launcher_name"
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package com.simplemobiletools.gallery
|
||||
|
||||
import android.app.Application
|
||||
import com.squareup.leakcanary.LeakCanary
|
||||
|
||||
class App : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (LeakCanary.isInAnalyzerProcess(this)) {
|
||||
return
|
||||
}
|
||||
LeakCanary.install(this)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue