mirror of
https://github.com/kyleneideck/BackgroundMusic
synced 2024-11-10 06:34:22 +00:00
Fix another crash when BGMDevice's volume is changed.
Fixes the same issue as df9815a4be
, but in
BGMOutputVolumeMenuItem instead of BGMStatusBarItem.
I think the problem was that it captured a weak reference in a C++
lambda, but it would capture by (C++) reference and when the reference
was used it would be referencing invalid memory. The fix to have the
lambda capture by value instead.
See #202.
This commit is contained in:
parent
2939dbe28c
commit
503d1a92ec
1 changed files with 1 additions and 1 deletions
|
@ -104,7 +104,7 @@ NSString* const __nonnull kGenericOutputDeviceName = @"Output Device";
|
|||
// Register a listener that will update the slider when the user changes the volume or
|
||||
// mutes/unmutes their audio.
|
||||
BGMOutputVolumeMenuItem* __weak weakSelf = self;
|
||||
volumeChangeListener = new BGMVolumeChangeListener(audioDevices.bgmDevice, [&] {
|
||||
volumeChangeListener = new BGMVolumeChangeListener(audioDevices.bgmDevice, [=] {
|
||||
[weakSelf updateVolumeSlider];
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue