From 4f5c4536439dc546c6ea0a7aadbeb9e481cf8031 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 11 Jul 2013 19:30:48 -0400 Subject: [PATCH] if the previewmodel has exited, the running threads should delete this --- src/gui/preview/PreviewModel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp index 8d5d574de..34d0c7f18 100644 --- a/src/gui/preview/PreviewModel.cpp +++ b/src/gui/preview/PreviewModel.cpp @@ -24,7 +24,10 @@ void * PreviewModel::updateSaveInfoT(void * obj) SaveInfo * tempSave = Client::Ref().GetSave(((threadInfo*)obj)->saveID, ((threadInfo*)obj)->saveDate); ((threadInfo*)obj)->threadFinished = true; if (((threadInfo*)obj)->previewExited && tempSave) + { delete tempSave; + delete obj; + } return tempSave; } @@ -40,6 +43,7 @@ void * PreviewModel::updateSaveDataT(void * obj) delete tempSave; if (tempData) free(tempData); + delete obj; } return tempSave; } @@ -54,6 +58,7 @@ void * PreviewModel::updateSaveCommentsT(void * obj) delete tempComments->at(i); tempComments->clear(); delete tempComments; + delete obj; } return tempComments; }