mirror of https://github.com/odrling/Aegisub
Fix memory leak in AssLimitToVisibleFilter
Originally committed to SVN as r4576.
This commit is contained in:
parent
2b47f34e76
commit
cf9eef80ab
|
@ -78,22 +78,18 @@ void AssLimitToVisibleFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog
|
|||
// Nothing to do
|
||||
if (frame == -1) return;
|
||||
|
||||
// Process
|
||||
using std::list;
|
||||
AssDialogue *diag;
|
||||
entryIter cur, next = subs->Line.begin();
|
||||
while (next != subs->Line.end()) {
|
||||
// Set next
|
||||
cur = next++;
|
||||
|
||||
// Is dialogue?
|
||||
diag = dynamic_cast<AssDialogue*>(*cur);
|
||||
if (diag) {
|
||||
int f1 = VFR_Output.GetFrameAtTime(diag->Start.GetMS(),true);
|
||||
int f2 = VFR_Output.GetFrameAtTime(diag->End.GetMS(),false);
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue