From: Mikko R. <mik...@ik...> - 2012-06-28 13:50:56
|
Fixes crashes if parent is destroyed. Found by krazy. Details at: http://blogs.kde.org/node/3919 --- src/customtrackview.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 82715d9..e6b71d5 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -3183,10 +3183,15 @@ void CustomTrackView::slotInsertSpace() pos = GenTime((int)(mapToScene(m_menuPosition).x()), m_document->fps()); track = (int)(mapToScene(m_menuPosition).y() / m_tracksHeight) + 1; } - SpacerDialog d(GenTime(65, m_document->fps()), m_document->timecode(), track, m_document->tracksList(), this); - if (d.exec() != QDialog::Accepted) return; - GenTime spaceDuration = d.selectedDuration(); - track = d.selectedTrack(); + QPointer<SpacerDialog> d = new SpacerDialog(GenTime(65, m_document->fps()), + m_document->timecode(), track, m_document->tracksList(), this); + if (d->exec() != QDialog::Accepted) { + delete d; + return; + } + GenTime spaceDuration = d->selectedDuration(); + track = d->selectedTrack(); + delete d; QList<QGraphicsItem *> items; if (track >= 0) { -- 1.7.10.4 |