Use deleteLater() on the FxLine when deleting a channel to prevent a crash
In Qt, it is not safe to delete a QObject inside a signal emitted by that QObject. This happened with FxLine when removing an FX channel using the context menu. This commit changes that by using deleteLater() instead of delete on the FxLine. It also hides the FxLine to prevent a ghost of it being drawn when deleting the last non-master FX channel.
This commit is contained in:
@@ -382,7 +382,9 @@ void FxMixerView::deleteChannel(int index)
|
||||
delete m_fxChannelViews[index]->m_fader;
|
||||
delete m_fxChannelViews[index]->m_muteBtn;
|
||||
delete m_fxChannelViews[index]->m_soloBtn;
|
||||
delete m_fxChannelViews[index]->m_fxLine;
|
||||
// delete fxLine later to prevent a crash when deleting from context menu
|
||||
m_fxChannelViews[index]->m_fxLine->hide();
|
||||
m_fxChannelViews[index]->m_fxLine->deleteLater();
|
||||
delete m_fxChannelViews[index]->m_rackView;
|
||||
delete m_fxChannelViews[index];
|
||||
m_channelAreaWidget->adjustSize();
|
||||
|
||||
Reference in New Issue
Block a user