Use QPointer, delete on error path [krazy 23/37] by Mikko Rapeli

parent 3034cfd4
......@@ -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<KUrlRequesterDialog> 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<KUrlRequesterDialog> 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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment