]> git.sesse.net Git - kdenlive/commitdiff
slotEditClipMarker: Use QPointer [krazy 26/37] by Mikko Rapeli
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 23 Jul 2012 07:11:42 +0000 (09:11 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 23 Jul 2012 07:11:42 +0000 (09:11 +0200)
src/mainwindow.cpp

index d91153ee03a46137f960fd282c8c24806a5a43fe..77e58d2adae00f640fec8ef3965435306b7df01e 100644 (file)
@@ -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<MarkerDialog> 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()