From 36e02374ff3175453f2d195a3b5dc3d2c1f251db Mon Sep 17 00:00:00 2001 From: Christian Hohnstaedt Date: Sun, 24 Oct 2021 20:29:48 +0200 Subject: [PATCH] Put XcaWarningBox on the stack not on the heap --- doc/CMakeLists.txt | 4 ++++ widgets/XcaWarning.cpp | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 0ec09d83..57da6503 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -100,6 +100,10 @@ if(SPHINX) endif() endif() +if (NOT SPHINX OR NOT QTCOLLGEN) + add_custom_target(sphinx-qthelp) +endif() + if (NOT WIN32) add_custom_command( OUTPUT "${D}/xca.1.gz" diff --git a/widgets/XcaWarning.cpp b/widgets/XcaWarning.cpp index 36a2b67b..c7772784 100644 --- a/widgets/XcaWarning.cpp +++ b/widgets/XcaWarning.cpp @@ -31,11 +31,9 @@ void xcaWarningBox::addButton(QMessageBox::StandardButton button, int xcaWarningGui::showBox(const QString &txt, QMessageBox::Icon icn, QMessageBox::StandardButtons b) { - xcaWarningBox *w = new xcaWarningBox(NULL, txt, icn); - w->setStandardButtons(b); - int n = w->exec(); - delete w; - return n; + xcaWarningBox w(NULL, txt, icn); + w.setStandardButtons(b); + return w.exec(); } void xcaWarningGui::information(const QString &msg)