Skip to content

Commit

Permalink
Use deleteLater() on the FxLine when deleting a channel to prevent a …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Fastigium committed Mar 14, 2016
1 parent 74c3f17 commit c972a04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/FxMixerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,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();
Expand Down

0 comments on commit c972a04

Please sign in to comment.