diff options
Diffstat (limited to 'src/preview')
| -rw-r--r-- | src/preview/PreviewModel.cpp | 6 | ||||
| -rw-r--r-- | src/preview/PreviewView.cpp | 19 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/preview/PreviewModel.cpp b/src/preview/PreviewModel.cpp index e1578e1..b5dbf40 100644 --- a/src/preview/PreviewModel.cpp +++ b/src/preview/PreviewModel.cpp @@ -316,5 +316,11 @@ void PreviewModel::Update() PreviewModel::~PreviewModel() { if(save) delete save; + if(saveComments) + { + for(int i = 0; i < saveComments->size(); i++) + delete saveComments->at(i); + delete saveComments; + } } diff --git a/src/preview/PreviewView.cpp b/src/preview/PreviewView.cpp index 4b12ea9..61a0c8f 100644 --- a/src/preview/PreviewView.cpp +++ b/src/preview/PreviewView.cpp @@ -411,7 +411,7 @@ void PreviewView::NotifySaveChanged(PreviewModel * sender) float factorY = ((float)YRES/2)/((float)savePreview->Size.Y); float scaleFactor = factorY < factorX ? factorY : factorX; savePreview->Data = Graphics::resample_img(oldData, savePreview->Size.X, savePreview->Size.Y, savePreview->Size.X*scaleFactor, savePreview->Size.Y*scaleFactor); - delete oldData; + delete[] oldData; savePreview->Size.X *= scaleFactor; savePreview->Size.Y *= scaleFactor; } @@ -453,14 +453,14 @@ void PreviewView::NotifyCommentBoxEnabledChanged(PreviewModel * sender) if(addCommentBox) { RemoveComponent(addCommentBox); - addCommentBox = NULL; delete addCommentBox; + addCommentBox = NULL; } if(submitCommentButton) { RemoveComponent(submitCommentButton); - submitCommentButton = NULL; delete submitCommentButton; + submitCommentButton = NULL; } if(sender->GetCommentBoxEnabled()) { @@ -561,6 +561,17 @@ void PreviewView::NotifyCommentsChanged(PreviewModel * sender) } }*/ -PreviewView::~PreviewView() { +PreviewView::~PreviewView() +{ + if(addCommentBox) + { + RemoveComponent(addCommentBox); + delete addCommentBox; + } + if(submitCommentButton) + { + RemoveComponent(submitCommentButton); + delete submitCommentButton; + } } |
