Fix memory leak in AssLimitToVisibleFilter
Originally committed to SVN as r4576.
This commit is contained in:
parent
2b47f34e76
commit
cf9eef80ab
1 changed files with 4 additions and 8 deletions
|
@ -78,22 +78,18 @@ void AssLimitToVisibleFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
if (frame == -1) return;
|
if (frame == -1) return;
|
||||||
|
|
||||||
// Process
|
|
||||||
using std::list;
|
|
||||||
AssDialogue *diag;
|
AssDialogue *diag;
|
||||||
entryIter cur, next = subs->Line.begin();
|
entryIter cur, next = subs->Line.begin();
|
||||||
while (next != subs->Line.end()) {
|
while (next != subs->Line.end()) {
|
||||||
// Set next
|
|
||||||
cur = next++;
|
cur = next++;
|
||||||
|
|
||||||
// Is dialogue?
|
|
||||||
diag = dynamic_cast<AssDialogue*>(*cur);
|
diag = dynamic_cast<AssDialogue*>(*cur);
|
||||||
if (diag) {
|
if (diag) {
|
||||||
int f1 = VFR_Output.GetFrameAtTime(diag->Start.GetMS(),true);
|
|
||||||
int f2 = VFR_Output.GetFrameAtTime(diag->End.GetMS(),false);
|
|
||||||
|
|
||||||
// Invisible, remove frame
|
// Invisible, remove frame
|
||||||
if (f1 > frame || f2 < frame) {
|
if (VFR_Output.GetFrameAtTime(diag->Start.GetMS(),true) > frame ||
|
||||||
|
VFR_Output.GetFrameAtTime(diag->End.GetMS(),false) < frame) {
|
||||||
|
|
||||||
|
delete *cur;
|
||||||
subs->Line.erase(cur);
|
subs->Line.erase(cur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue