mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
UI: Fix crash when toggling volume control mode
The toggleControlLayoutAction (change between horizontal and vertical display mode) deletes and re-recreates the volume controls, meaning we were writing to freed memory. This is a kind of hacky fix but it's the only action we need to be concerned with for now.
This commit is contained in:
parent
2c7ef7d682
commit
c64997ed80
@ -3509,8 +3509,11 @@ void OBSBasic::VolControlContextMenu()
|
||||
popup.addAction(&filtersAction);
|
||||
popup.addAction(&propertiesAction);
|
||||
popup.addAction(&advPropAction);
|
||||
popup.exec(QCursor::pos());
|
||||
vol->SetContextMenu(nullptr);
|
||||
|
||||
// toggleControlLayoutAction deletes and re-creates the volume controls
|
||||
// meaning that "vol" would be pointing to freed memory.
|
||||
if (popup.exec(QCursor::pos()) != &toggleControlLayoutAction)
|
||||
vol->SetContextMenu(nullptr);
|
||||
}
|
||||
|
||||
void OBSBasic::on_hMixerScrollArea_customContextMenuRequested()
|
||||
|
Loading…
Reference in New Issue
Block a user