FileBrowser: fix sort race condition at resume
On some devices, when first fetching the dataset for the browser, browseImpl will be called during the reSort that is called by onResume. This means that the reSort starts with a empty dataset, browseImpl populates it, and reSort finishes by reassigning an empty set to dataset.value. In on Resume if the dataset is empty then it will be populated and sorted by browseImpl, if it is not, then it has already been populated, but possibly with the wrong sort as resetSort hasn't been called. Hence in this case reSort should be called just in case
Showing
- application/vlc-android/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt 3 additions, 1 deletion...d/src/org/videolan/vlc/gui/browser/FileBrowserFragment.kt
- application/vlc-android/src/org/videolan/vlc/viewmodels/browser/BrowserModel.kt 1 addition, 2 deletions...d/src/org/videolan/vlc/viewmodels/browser/BrowserModel.kt
Loading
Please register or sign in to comment