Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
2adb9f97 by Claudio Cambra at 2023-01-05T13:03:46+00:00
macosx: Use weak property on representedMediaItem of 
VLCLibrarySongTableCellView, preventing crash when switching songs in other 
views

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -


2 changed files:

- 
modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.h
- 
modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.m


Changes:

=====================================
modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.h
=====================================
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface VLCLibrarySongsTableViewSongPlayingTableCellView : NSTableCellView
 
-@property (readwrite, assign, nonatomic) VLCMediaLibraryMediaItem 
*representedMediaItem;
+@property (readwrite, weak, nonatomic) VLCMediaLibraryMediaItem 
*representedMediaItem;
 
 @end
 


=====================================
modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.m
=====================================
@@ -62,7 +62,12 @@
 
 - (BOOL)isCurrentSong
 {
-    if (!_representedMediaItem) {
+    if (!_representedMediaItem ||
+        !_representedMediaItem.inputItem ||
+        !VLCMain.sharedInstance ||
+        !VLCMain.sharedInstance.playlistController ||
+        !VLCMain.sharedInstance.playlistController.currentlyPlayingInputItem) {
+
         return false;
     }
 



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/2adb9f97036ae2820ff38dd15b252e101a7da040

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/2adb9f97036ae2820ff38dd15b252e101a7da040
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to