From: Jean-Baptiste Mardelle Date: Mon, 23 Jul 2012 07:09:30 +0000 (+0200) Subject: Use QPointer, delete on error path [krazy 23/37] by Mikko Rapeli X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7f1da508760806124e9ef3c270e838ab0b347e20;p=kdenlive Use QPointer, delete on error path [krazy 23/37] by Mikko Rapeli --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 81228a9b..4529d9be 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2220,8 +2220,9 @@ void MainWindow::parseProfiles(const QString &mltPath) if (KdenliveSettings::rendererpath().isEmpty()) { // Cannot find the MLT melt renderer, ask for location - KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(QString(), i18n("Cannot find the melt program required for rendering (part of MLT)"), this); + QPointer getUrl = new KUrlRequesterDialog(QString(), i18n("Cannot find the melt program required for rendering (part of MLT)"), this); if (getUrl->exec() == QDialog::Rejected) { + delete getUrl; ::exit(0); } KUrl rendererPath = getUrl->selectedUrl(); @@ -2243,9 +2244,10 @@ void MainWindow::parseProfiles(const QString &mltPath) } if (profilesList.isEmpty()) { // Cannot find the MLT profiles, ask for location - KUrlRequesterDialog *getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find your MLT profiles, please give the path"), this); + QPointer getUrl = new KUrlRequesterDialog(KdenliveSettings::mltpath(), i18n("Cannot find your MLT profiles, please give the path"), this); getUrl->fileDialog()->setMode(KFile::Directory); if (getUrl->exec() == QDialog::Rejected) { + delete getUrl; ::exit(0); } KUrl mltPath = getUrl->selectedUrl();