From: Jean-Baptiste Mardelle Date: Mon, 23 Jul 2012 07:11:42 +0000 (+0200) Subject: slotEditClipMarker: Use QPointer [krazy 26/37] by Mikko Rapeli X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a14d57eda646d53128ce0dd5ef11f375bab2c904;p=kdenlive slotEditClipMarker: Use QPointer [krazy 26/37] by Mikko Rapeli --- 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()