[Android] Fix FavoritesProvider leaking the context

Nicolas Pomepuy git at videolan.org
Wed Oct 11 16:41:42 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Oct 10 13:50:12 2023 +0200| [1e867a9839403cc452b0f739571d5e0ed2e4c030] | committer: Duncan McNamara

Fix FavoritesProvider leaking the context

> https://code.videolan.org/videolan/vlc-android/commit/1e867a9839403cc452b0f739571d5e0ed2e4c030
---

 .../src/org/videolan/vlc/viewmodels/browser/BrowserFavoritesModel.kt  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserFavoritesModel.kt b/application/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserFavoritesModel.kt
index fa5ca05789..ef166f106a 100644
--- a/application/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserFavoritesModel.kt
+++ b/application/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserFavoritesModel.kt
@@ -43,9 +43,9 @@ import org.videolan.vlc.providers.BrowserProvider
 import org.videolan.vlc.repository.BrowserFavRepository
 import org.videolan.vlc.util.convertFavorites
 
-class BrowserFavoritesModel(private val context: Context) : ViewModel() {
+class BrowserFavoritesModel(context: Context) : ViewModel() {
     val favorites = LiveDataset<MediaLibraryItem>()
-    val provider = FavoritesProvider(context, favorites, viewModelScope)
+    val provider = FavoritesProvider(context.applicationContext, favorites, viewModelScope)
 }
 
 class FavoritesProvider(



More information about the Android mailing list