From 8da5a8649bec48b562c0983a8fe42b594e23d60c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 24 Dec 2013 10:01:20 -0200 Subject: Don't check if pointer is valid before deleting it. deleting a null pointer is valid, so we just delete it instead of checking if it exists. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divecomputermanagementdialog.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/divecomputermanagementdialog.cpp b/qt-ui/divecomputermanagementdialog.cpp index af27e914f..348f93b40 100644 --- a/qt-ui/divecomputermanagementdialog.cpp +++ b/qt-ui/divecomputermanagementdialog.cpp @@ -15,8 +15,7 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget* parent, Qt:: void DiveComputerManagementDialog::init() { - if (model) - delete model; + delete model; model = new DiveComputerModel(dcList.dcMap); ui.tableView->setModel(model); } -- cgit v1.2.3-70-g09d2