diff options
| author | jacob1 <jfu614@gmail.com> | 2013-07-12 02:43:36 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-07-12 02:43:36 (GMT) |
| commit | a06202c78f392db833733d621974af1edcdb1cec (patch) | |
| tree | 14448710c9699662ca0ca72acb187c18dd1dc6ee /src/gui/preview/PreviewModel.cpp | |
| parent | 4f5c4536439dc546c6ea0a7aadbeb9e481cf8031 (diff) | |
| download | powder-a06202c78f392db833733d621974af1edcdb1cec.zip powder-a06202c78f392db833733d621974af1edcdb1cec.tar.gz | |
fixes to wall and particle floodfill. Wall fill ignores particles and always goes to the edges, while particle fill will only ignore walls it can't exist in, and flood particle erase won't check for walls / edges at all
Diffstat (limited to 'src/gui/preview/PreviewModel.cpp')
| -rw-r--r-- | src/gui/preview/PreviewModel.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp index 34d0c7f..88b281b 100644 --- a/src/gui/preview/PreviewModel.cpp +++ b/src/gui/preview/PreviewModel.cpp @@ -23,9 +23,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) + if (((threadInfo*)obj)->previewExited) { - delete tempSave; + if (tempSave) + delete tempSave; delete obj; } return tempSave; @@ -52,12 +53,15 @@ void * PreviewModel::updateSaveCommentsT(void * obj) { std::vector<SaveComment*> * tempComments = Client::Ref().GetComments(((threadInfo*)obj)->saveID, (((threadInfo*)obj)->saveDate-1)*20, 20); //saveDate is used as commentsPageNumber ((threadInfo*)obj)->threadFinished = true; - if (((threadInfo*)obj)->previewExited && tempComments) + if (((threadInfo*)obj)->previewExited) { - for(int i = 0; i < tempComments->size(); i++) - delete tempComments->at(i); - tempComments->clear(); - delete tempComments; + if (tempComments) + { + for(int i = 0; i < tempComments->size(); i++) + delete tempComments->at(i); + tempComments->clear(); + delete tempComments; + } delete obj; } return tempComments; |
