summaryrefslogtreecommitdiff
path: root/src/gui/preview/PreviewModel.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-07-11 23:30:48 (GMT)
committer jacob1 <jfu614@gmail.com>2013-07-11 23:30:48 (GMT)
commit4f5c4536439dc546c6ea0a7aadbeb9e481cf8031 (patch)
tree86b5e056081a3a55accf455eb12a2de2fbc5ac3f /src/gui/preview/PreviewModel.cpp
parentc29bfd285de0b94b32860b783f686d14dfb8ba15 (diff)
downloadpowder-4f5c4536439dc546c6ea0a7aadbeb9e481cf8031.zip
powder-4f5c4536439dc546c6ea0a7aadbeb9e481cf8031.tar.gz
if the previewmodel has exited, the running threads should delete this
Diffstat (limited to 'src/gui/preview/PreviewModel.cpp')
-rw-r--r--src/gui/preview/PreviewModel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp
index 8d5d574..34d0c7f 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;
}