Fixes crashes if parent is destroyed. Found by krazy. Details at: http://blogs.kde.org/node/3919 --- src/customtrackview.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 38f557d..35927ed 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -5931,21 +5931,21 @@ void CustomTrackView::saveThumbnails() void CustomTrackView::slotInsertTrack(int ix) { - TrackDialog d(m_document, parentWidget()); - d.comboTracks->setCurrentIndex(ix); - d.label->setText(i18n("Insert track")); - d.setWindowTitle(i18n("Insert New Track")); + QPointer<TrackDialog> d = new TrackDialog(m_document, parentWidget()); + d->comboTracks->setCurrentIndex(ix); + d->label->setText(i18n("Insert track")); + d->setWindowTitle(i18n("Insert New Track")); - if (d.exec() == QDialog::Accepted) { - ix = d.comboTracks->currentIndex(); - if (d.before_select->currentIndex() == 1) + if (d->exec() == QDialog::Accepted) { + ix = d->comboTracks->currentIndex(); + if (d->before_select->currentIndex() == 1) ix++; TrackInfo info; info.duration = 0; info.isMute = false; info.isLocked = false; info.effectsList = EffectsList(true); - if (d.video_track->isChecked()) { + if (d->video_track->isChecked()) { info.type = VIDEOTRACK; info.isBlind = false; } else { @@ -5956,6 +5956,7 @@ void CustomTrackView::slotInsertTrack(int ix) m_commandStack->push(addTrack); setDocumentModified(); } + delete d; } void CustomTrackView::slotDeleteTrack(int ix) -- 1.7.10.4 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Kdenlive-devel mailing list Kdenlive-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kdenlive-devel