From 6ff8de8972cbb00c35dac9a344c5b53a0468101d Mon Sep 17 00:00:00 2001 From: Rafael Date: Wed, 13 Apr 2016 00:41:06 +0200 Subject: [PATCH] delete selected crash bug fix --- ProfileInterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index c06fb6b..9cea36b 100755 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -308,7 +308,9 @@ void ProfileInterface::savegameDeleted_f(QWidget *sgdWidget_) SavegameWidget *sgdWidget = (SavegameWidget*)sgdWidget_; SavegameData *savegame = sgdWidget->getSavegame(); if (sgdWidget->isSelected()) { sgdWidget->setSelected(false); } + widgets.remove(sgdWidget); sgdWidget->close(); + sgdWidget->deleteLater(); savegames.removeAll(savegame); delete savegame; } @@ -324,6 +326,8 @@ void ProfileInterface::pictureDeleted_f(QWidget *picWidget_) SnapmaticPicture *picture = picWidget->getPicture(); if (picWidget->isSelected()) { picWidget->setSelected(false); } picWidget->close(); + widgets.remove(picWidget); + picWidget->deleteLater(); pictures.removeAll(picture); delete picture; }