mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-11-04 01:03:00 +00:00 
			
		
		
		
	Update LeakCanary library
This commit is contained in:
		@@ -119,7 +119,7 @@ ext {
 | 
				
			|||||||
    groupieVersion = '2.10.1'
 | 
					    groupieVersion = '2.10.1'
 | 
				
			||||||
    markwonVersion = '4.6.2'
 | 
					    markwonVersion = '4.6.2'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    leakCanaryVersion = '2.9.1'
 | 
					    leakCanaryVersion = '2.12'
 | 
				
			||||||
    stethoVersion = '1.6.0'
 | 
					    stethoVersion = '1.6.0'
 | 
				
			||||||
    mockitoVersion = '4.0.0'
 | 
					    mockitoVersion = '4.0.0'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -290,7 +290,7 @@ dependencies {
 | 
				
			|||||||
    // Memory leak detection
 | 
					    // Memory leak detection
 | 
				
			||||||
    implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${leakCanaryVersion}"
 | 
					    implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${leakCanaryVersion}"
 | 
				
			||||||
    implementation "com.squareup.leakcanary:plumber-android:${leakCanaryVersion}"
 | 
					    implementation "com.squareup.leakcanary:plumber-android:${leakCanaryVersion}"
 | 
				
			||||||
    debugImplementation "com.squareup.leakcanary:leakcanary-android:${leakCanaryVersion}"
 | 
					    debugImplementation "com.squareup.leakcanary:leakcanary-android-core:${leakCanaryVersion}"
 | 
				
			||||||
    // Debug bridge for Android
 | 
					    // Debug bridge for Android
 | 
				
			||||||
    debugImplementation "com.facebook.stetho:stetho:${stethoVersion}"
 | 
					    debugImplementation "com.facebook.stetho:stetho:${stethoVersion}"
 | 
				
			||||||
    debugImplementation "com.facebook.stetho:stetho-okhttp3:${stethoVersion}"
 | 
					    debugImplementation "com.facebook.stetho:stetho-okhttp3:${stethoVersion}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@ class DebugApp : App() {
 | 
				
			|||||||
        initStetho()
 | 
					        initStetho()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Give each object 10 seconds to be GC'ed, before LeakCanary gets nosy on it
 | 
					        // Give each object 10 seconds to be GC'ed, before LeakCanary gets nosy on it
 | 
				
			||||||
        AppWatcher.config = AppWatcher.config.copy(watchDurationMillis = 10000)
 | 
					        AppWatcher.manualInstall(this, retainedDelayMillis = 10000)
 | 
				
			||||||
        LeakCanary.config = LeakCanary.config.copy(
 | 
					        LeakCanary.config = LeakCanary.config.copy(
 | 
				
			||||||
            dumpHeap = PreferenceManager
 | 
					            dumpHeap = PreferenceManager
 | 
				
			||||||
                .getDefaultSharedPreferences(this).getBoolean(
 | 
					                .getDefaultSharedPreferences(this).getBoolean(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -81,7 +81,8 @@ public abstract class BaseFragment extends Fragment {
 | 
				
			|||||||
    public void onDestroy() {
 | 
					    public void onDestroy() {
 | 
				
			||||||
        super.onDestroy();
 | 
					        super.onDestroy();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        AppWatcher.INSTANCE.getObjectWatcher().watch(this);
 | 
					        AppWatcher.INSTANCE.getObjectWatcher().expectWeaklyReachable(
 | 
				
			||||||
 | 
					                this, "Watch for leaks from destroyed fragments.");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*//////////////////////////////////////////////////////////////////////////
 | 
					    /*//////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user