1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-10-31 15:23:00 +00:00

-Added LeakCanary to debug build for memory detection on activities and fragments.

-Added LeakCanary no-op lib to release and beta builds.
This commit is contained in:
John Zhen Mo
2018-02-08 12:46:54 -08:00
parent e88312659b
commit 622d698ff8
4 changed files with 41 additions and 0 deletions

View File

@@ -4,6 +4,10 @@ import android.content.Context;
import android.support.multidex.MultiDex;
import com.facebook.stetho.Stetho;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import java.util.concurrent.TimeUnit;
public class DebugApp extends App {
private static final String TAG = DebugApp.class.toString();
@@ -41,4 +45,11 @@ public class DebugApp extends App {
// Initialize Stetho with the Initializer
Stetho.initialize(initializer);
}
@Override
protected RefWatcher installLeakCanary() {
return LeakCanary.refWatcher(this)
.watchDelay(5, TimeUnit.SECONDS)
.buildAndInstall();
}
}