From bab378b17c39dd3f0e1e57863ebf4f29f7f4d346 Mon Sep 17 00:00:00 2001 From: Emanoil Kotsev Date: Sun, 18 Sep 2022 12:19:01 +0000 Subject: [PATCH] Prevent crashing from ntqvaluelist in ~TQApplication, when closing the app Signed-off-by: Emanoil Kotsev --- krecipes/src/krecipesview.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/krecipes/src/krecipesview.cpp b/krecipes/src/krecipesview.cpp index 7a611bc..17eb312 100644 --- a/krecipes/src/krecipesview.cpp +++ b/krecipes/src/krecipesview.cpp @@ -291,10 +291,13 @@ KrecipesView::KrecipesView( TQWidget *parent ) KrecipesView::~KrecipesView() { - delete buttonsList; - delete viewPanel; //manually delete viewPanel because we need to be sure it is deleted + if (buttonsList) + delete buttonsList; + if (viewPanel) + delete viewPanel; //manually delete viewPanel because we need to be sure it is deleted //before the database is because its destructor uses 'database' - delete database; + if (database) + delete database; } bool KrecipesView::questionRerunWizard( const TQString &message, const TQString &error )