mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 01:46:16 +00:00
It's safe to delete NULL pointers
Small code cleanup, it's safe to delete null pointers. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
040e172d33
commit
9661926131
1 changed files with 2 additions and 4 deletions
|
@ -155,8 +155,7 @@ void MainWindow::refreshDisplay(bool doRecreateDiveList)
|
||||||
WSInfoModel::instance()->updateInfo();
|
WSInfoModel::instance()->updateInfo();
|
||||||
// refresh the yearly stats if the window has an instance
|
// refresh the yearly stats if the window has an instance
|
||||||
if (yearlyStats) {
|
if (yearlyStats) {
|
||||||
if (yearlyStatsModel)
|
delete yearlyStatsModel;
|
||||||
delete yearlyStatsModel;
|
|
||||||
yearlyStatsModel = new YearlyStatisticsModel();
|
yearlyStatsModel = new YearlyStatisticsModel();
|
||||||
yearlyStats->setModel(yearlyStatsModel);
|
yearlyStats->setModel(yearlyStatsModel);
|
||||||
}
|
}
|
||||||
|
@ -525,8 +524,7 @@ void MainWindow::on_actionYearlyStatistics_triggered()
|
||||||
/* problem here is that without more MainWindow variables or a separate YearlyStatistics
|
/* problem here is that without more MainWindow variables or a separate YearlyStatistics
|
||||||
* class the user needs to close the window/widget and re-open it for it to update.
|
* class the user needs to close the window/widget and re-open it for it to update.
|
||||||
*/
|
*/
|
||||||
if (yearlyStatsModel)
|
delete yearlyStatsModel;
|
||||||
delete yearlyStatsModel;
|
|
||||||
yearlyStatsModel = new YearlyStatisticsModel();
|
yearlyStatsModel = new YearlyStatisticsModel();
|
||||||
yearlyStats->setModel(yearlyStatsModel);
|
yearlyStats->setModel(yearlyStatsModel);
|
||||||
yearlyStats->raise();
|
yearlyStats->raise();
|
||||||
|
|
Loading…
Add table
Reference in a new issue