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

index d1d610aa0a8dd24526b9a066a8eba94accacb30a..ed3c0371e99f3df07986e9043d99f7538dfd6959 100644 (file)
@@ -718,11 +718,13 @@ void ClipProperties::slotFillMarkersList()
 void ClipProperties::slotAddMarker()
 {
     CommentedTime marker(GenTime(), i18n("Marker"));
-    MarkerDialog d(m_clip, marker, m_tc, i18n("Add Marker"), this);
-    if (d.exec() == QDialog::Accepted) {
-        emit addMarker(m_clip->getId(), d.newMarker().time(), d.newMarker().comment());
+    QPointer<MarkerDialog> d = new MarkerDialog(m_clip, marker,
+                                          m_tc, i18n("Add Marker"), this);
+    if (d->exec() == QDialog::Accepted) {
+        emit addMarker(m_clip->getId(), d->newMarker().time(), d->newMarker().comment());
     }
     QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
+    delete d;
 }
 
 void ClipProperties::slotEditMarker()