Fix memory leak when deleting or cutting rows

Originally committed to SVN as r6045.
This commit is contained in:
Thomas Goyne 2011-12-22 21:16:34 +00:00
parent 79fa487678
commit ed51e7b668

View file

@ -310,6 +310,7 @@ void SubtitlesGrid::DeleteLines(wxArrayInt target, bool flagModified) {
size_t deleted = 0;
for (entryIter cur = context->ass->Line.begin(); cur != context->ass->Line.end();) {
if (dynamic_cast<AssDialogue*>(*cur) && ++row == target[deleted]) {
delete *cur;
cur = context->ass->Line.erase(cur);
++deleted;
if (deleted == target.size()) break;