Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix possible crash on track deletion. Fixes #131

parent 52632a81
Pipeline #2253 passed with stage
in 15 minutes and 32 seconds
......@@ -498,9 +498,19 @@ void TimelineController::deleteTrack(int tid)
QPointer<TrackDialog> d = new TrackDialog(m_model, tid, qApp->activeWindow(), true);
if (d->exec() == QDialog::Accepted) {
int selectedTrackIx = d->selectedTrackId();
if (m_activeTrack == selectedTrackIx) {
// Make sure we don't keep an index on a deleted track
m_activeTrack = -1;
}
if (m_model->m_audioTarget == selectedTrackIx) {
setAudioTarget(-1);
}
if (m_model->m_videoTarget == selectedTrackIx) {
setVideoTarget(-1);
}
m_model->requestTrackDeletion(selectedTrackIx);
m_model->buildTrackCompositing(true);
if (m_activeTrack == selectedTrackIx) {
if (m_activeTrack == -1) {
setActiveTrack(m_model->getTrackIndexFromPosition(m_model->getTracksCount() - 1));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment