From 1eff322c2a3cc238a414312026bdb9d6ebfbe3b0 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sun, 7 Jan 2024 10:06:34 +0100 Subject: [PATCH] Fix crash on subsequent song loads (#7051) 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 #7046. --- src/gui/MixerView.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index f20b60a38..a28ac7976 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -206,8 +206,11 @@ void MixerView::refreshDisplay() // delete all views and re-add them for (int i = 1; iremoveWidget(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();