File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
debug/java/org/schabi/newpipe
main/java/org/schabi/newpipe Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ ext {
119119 groupieVersion = ' 2.10.1'
120120 markwonVersion = ' 4.6.2'
121121
122- leakCanaryVersion = ' 2.9.1 '
122+ leakCanaryVersion = ' 2.11 '
123123 stethoVersion = ' 1.6.0'
124124 mockitoVersion = ' 4.0.0'
125125 assertJVersion = ' 3.23.1'
@@ -291,7 +291,7 @@ dependencies {
291291 // Memory leak detection
292292 implementation " com.squareup.leakcanary:leakcanary-object-watcher-android:${ leakCanaryVersion} "
293293 implementation " com.squareup.leakcanary:plumber-android:${ leakCanaryVersion} "
294- debugImplementation " com.squareup.leakcanary:leakcanary-android:${ leakCanaryVersion} "
294+ debugImplementation " com.squareup.leakcanary:leakcanary-android-core :${ leakCanaryVersion} "
295295 // Debug bridge for Android
296296 debugImplementation " com.facebook.stetho:stetho:${ stethoVersion} "
297297 debugImplementation " com.facebook.stetho:stetho-okhttp3:${ stethoVersion} "
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class DebugApp : App() {
1414 initStetho()
1515
1616 // Give each object 10 seconds to be GC'ed, before LeakCanary gets nosy on it
17- AppWatcher .config = AppWatcher .config.copy(watchDurationMillis = 10000 )
17+ AppWatcher .manualInstall( this , retainedDelayMillis = 10000 )
1818 LeakCanary .config = LeakCanary .config.copy(
1919 dumpHeap = PreferenceManager
2020 .getDefaultSharedPreferences(this ).getBoolean(
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ protected void onRestoreInstanceState(@NonNull final Bundle savedInstanceState)
8181 public void onDestroy () {
8282 super .onDestroy ();
8383
84- AppWatcher .INSTANCE .getObjectWatcher ().watch (this );
84+ AppWatcher .INSTANCE .getObjectWatcher ().expectWeaklyReachable (
85+ this , "Watch for leaks from destroyed fragments." );
8586 }
8687
8788 /*//////////////////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments