Skip to content

Commit

Permalink
Fix crash on subsequent song loads
Browse files Browse the repository at this point in the history
Fix a crash that occurs when songs are loaded after each other. The crash only occurs if the "participating" songs have at least one other channel besides the master channel.

The crash occurred because the `MixerChannelViews` were not really deleted in `MixerView::refreshDisplay`. As a consequence the parent child relationship was still given between the `MixerView` and the `MixerChannelView`. When a song was loaded the event queue was evaluated which in turn resulted in the method `Fader::knobPosY` being called on a `Fader` which did not have a model anymore.

Fixes LMMS#7046.
  • Loading branch information
michaelgregorius committed Jan 6, 2024
1 parent 56e7f7d commit 808f6cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/MixerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ void MixerView::refreshDisplay()
// delete all views and re-add them
for (int i = 1; i<m_mixerChannelViews.size(); ++i)
{
chLayout->removeWidget(m_mixerChannelViews[i]);
m_racksLayout->removeWidget(m_mixerChannelViews[i]->m_effectRackView);
auto * mixerChannelView = m_mixerChannelViews[i];
chLayout->removeWidget(mixerChannelView);
m_racksLayout->removeWidget(mixerChannelView->m_effectRackView);

delete mixerChannelView;
}
m_channelAreaWidget->adjustSize();

Expand Down

0 comments on commit 808f6cb

Please sign in to comment.