mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
add leak canary for detecting memory leaks at debug builds
This commit is contained in:
parent
c4c19f82af
commit
d914f0bb53
3 changed files with 19 additions and 0 deletions
|
@ -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"
|
||||
|
|
14
app/src/main/kotlin/com/simplemobiletools/gallery/App.kt
Normal file
14
app/src/main/kotlin/com/simplemobiletools/gallery/App.kt
Normal file
|
@ -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 a new issue