[vlc-commits] macosx: Properly clear playlist model on reset

Marvin Scholz git at videolan.org
Wed May 15 22:44:25 CEST 2019


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed May 15 22:43:43 2019 +0200| [0737744c88256baa392f12e3dcf0e1398ba2a52a] | committer: Marvin Scholz

macosx: Properly clear playlist model on reset

Not clearing the model leads to old (invalid) items remaining in the
table, when those are interacted with, for example deleted, invalid
items are handled to the playlist core calls and things will break.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0737744c88256baa392f12e3dcf0e1398ba2a52a
---

 modules/gui/macosx/playlist/VLCPlaylistController.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.m b/modules/gui/macosx/playlist/VLCPlaylistController.m
index 7512d9fdbd..33d5f2cd40 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.m
@@ -244,6 +244,9 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
 
 - (void)playlistResetWithItems:(NSArray *)items
 {
+    // Clear all items (reset)
+    [_playlistModel dropExistingData];
+
     [_playlistModel addItems:items];
 
     [_playlistDataSource playlistUpdated];



More information about the vlc-commits mailing list