[vlc-commits] [Git][videolan/vlc][master] macosx: Use weak property on representedMediaItem of...

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jan 5 16:16:08 UTC 2023



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 <developer at claudiocambra.com>

- - - - -


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
 
- at property (readwrite, assign, nonatomic) VLCMediaLibraryMediaItem *representedMediaItem;
+ at 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


More information about the vlc-commits mailing list