Commit 3d3878d3 authored by David Fuhrmann's avatar David Fuhrmann

macosx: Fix crash when deinitializing PLModel

Only self should be used as callback parameters. Otherwise,
depending on the destruction order the original object might be
deinitialized already.
parent e5940f08
...@@ -93,8 +93,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var, ...@@ -93,8 +93,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
{ {
@autoreleasepool { @autoreleasepool {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
VLCMainWindow *mainWindow = (__bridge VLCMainWindow*)param; [[[VLCMain sharedInstance] mainWindow] updateVolumeSlider];
[mainWindow updateVolumeSlider];
}); });
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -133,8 +132,8 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var, ...@@ -133,8 +132,8 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
var_AddCallback(p_playlist, "random", PlaybackModeUpdated, (__bridge void *)self); var_AddCallback(p_playlist, "random", PlaybackModeUpdated, (__bridge void *)self);
var_AddCallback(p_playlist, "repeat", PlaybackModeUpdated, (__bridge void *)self); var_AddCallback(p_playlist, "repeat", PlaybackModeUpdated, (__bridge void *)self);
var_AddCallback(p_playlist, "loop", PlaybackModeUpdated, (__bridge void *)self); var_AddCallback(p_playlist, "loop", PlaybackModeUpdated, (__bridge void *)self);
var_AddCallback(p_playlist, "volume", VolumeUpdated, (__bridge void *)[[VLCMain sharedInstance] mainWindow]); var_AddCallback(p_playlist, "volume", VolumeUpdated, (__bridge void *)self);
var_AddCallback(p_playlist, "mute", VolumeUpdated, (__bridge void *)[[VLCMain sharedInstance] mainWindow]); var_AddCallback(p_playlist, "mute", VolumeUpdated, (__bridge void *)self);
PL_LOCK; PL_LOCK;
_rootItem = [[PLItem alloc] initWithPlaylistItem:root]; _rootItem = [[PLItem alloc] initWithPlaylistItem:root];
...@@ -153,8 +152,8 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var, ...@@ -153,8 +152,8 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
var_DelCallback(p_playlist, "random", PlaybackModeUpdated, (__bridge void *)self); var_DelCallback(p_playlist, "random", PlaybackModeUpdated, (__bridge void *)self);
var_DelCallback(p_playlist, "repeat", PlaybackModeUpdated, (__bridge void *)self); var_DelCallback(p_playlist, "repeat", PlaybackModeUpdated, (__bridge void *)self);
var_DelCallback(p_playlist, "loop", PlaybackModeUpdated, (__bridge void *)self); var_DelCallback(p_playlist, "loop", PlaybackModeUpdated, (__bridge void *)self);
var_DelCallback(p_playlist, "volume", VolumeUpdated, (__bridge void *)[[VLCMain sharedInstance] mainWindow]); var_DelCallback(p_playlist, "volume", VolumeUpdated, (__bridge void *)self);
var_DelCallback(p_playlist, "mute", VolumeUpdated, (__bridge void *)[[VLCMain sharedInstance] mainWindow]); var_DelCallback(p_playlist, "mute", VolumeUpdated, (__bridge void *)self);
} }
- (void)changeRootItem:(playlist_item_t *)p_root; - (void)changeRootItem:(playlist_item_t *)p_root;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment