Skip to content

Commit 4f0315d

Browse files
committed
内存泄漏检测
1 parent 145d8b4 commit 4f0315d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ dependencies {
8484
compile 'me.imid.swipebacklayout.lib:library:1.0.0'
8585
compile 'com.github.chrisbanes:PhotoView:2.1.2'
8686
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
87+
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
8788
compile 'com.tencent.bugly:crashreport_upgrade:1.3.1'
8889
// 非常强悍的RecyclerView
8990
compile 'eu.davidea:flexible-adapter:5.0.0-rc2'

app/src/main/java/com/rae/cnblogs/CnblogsApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public CnblogsApplication() {
2828
@Override
2929
public void onCreate() {
3030
super.onCreate();
31-
if (BuildConfig.DEBUG) {
31+
if (BuildConfig.DEBUG && LeakCanary.isInAnalyzerProcess(this)) {
3232
refWatcher = LeakCanary.install(this);
3333
}
3434
}

0 commit comments

Comments
 (0)