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:
		| @@ -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(); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 John Zhen Mo
					John Zhen Mo