Fixed a memory leak that occurred when using undo/redo, fixes #330

Originally committed to SVN as r3007.
This commit is contained in:
harukalover 2009-06-03 19:55:39 +00:00
parent 5c89ff4a50
commit 016ed435b1

View file

@ -939,6 +939,7 @@ void AssFile::StackPop() {
if (StackModified) { if (StackModified) {
undodesc=UndoStack.back()->undodescription; undodesc=UndoStack.back()->undodescription;
delete UndoStack.back();
UndoStack.pop_back(); UndoStack.pop_back();
StackModified = false; StackModified = false;
addcopy = true; addcopy = true;
@ -968,6 +969,7 @@ void AssFile::StackRedo() {
bool addcopy = false; bool addcopy = false;
if (StackModified) { if (StackModified) {
delete UndoStack.back();
UndoStack.pop_back(); UndoStack.pop_back();
StackModified = false; StackModified = false;
addcopy = true; addcopy = true;