From a14d57eda646d53128ce0dd5ef11f375bab2c904 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Mon, 23 Jul 2012 09:11:42 +0200 Subject: [PATCH] slotEditClipMarker: Use QPointer [krazy 26/37] by Mikko Rapeli --- src/mainwindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d91153ee..77e58d2a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2919,14 +2919,16 @@ void MainWindow::slotEditClipMarker() } CommentedTime marker(pos, oldcomment); - MarkerDialog d(clip, marker, m_activeDocument->timecode(), i18n("Edit Marker"), this); - if (d.exec() == QDialog::Accepted) { - m_activeTimeline->projectView()->slotAddClipMarker(id, d.newMarker().time(), d.newMarker().comment()); - if (d.newMarker().time() != pos) { + QPointer d = new MarkerDialog(clip, marker, + m_activeDocument->timecode(), i18n("Edit Marker"), this); + if (d->exec() == QDialog::Accepted) { + m_activeTimeline->projectView()->slotAddClipMarker(id, d->newMarker().time(), d->newMarker().comment()); + if (d->newMarker().time() != pos) { // remove old marker m_activeTimeline->projectView()->slotAddClipMarker(id, pos, QString()); } } + delete d; } void MainWindow::slotAddMarkerGuideQuickly() -- 2.39.5