forked from mia/Aegisub
Fix potential crash when deleting lines with audio open
Don't assume that the active line is valid in RegenerateInactiveLines, as it may get called by the commit signal before the selection is updated when the active line is deleted. Closes #1502. Originally committed to SVN as r6932.
This commit is contained in:
parent
5162c28684
commit
60c38bd2e5
1 changed files with 2 additions and 0 deletions
|
@ -736,6 +736,8 @@ void AudioTimingControllerDialogue::RegenerateInactiveLines()
|
||||||
{
|
{
|
||||||
std::list<AssEntry*>::iterator current_line =
|
std::list<AssEntry*>::iterator current_line =
|
||||||
find(context->ass->Line.begin(), context->ass->Line.end(), line);
|
find(context->ass->Line.begin(), context->ass->Line.end(), line);
|
||||||
|
if (current_line == context->ass->Line.end())
|
||||||
|
break;
|
||||||
|
|
||||||
std::list<AssEntry*>::iterator prev = current_line;
|
std::list<AssEntry*>::iterator prev = current_line;
|
||||||
while (--prev != context->ass->Line.begin() && !predicate(*prev)) ;
|
while (--prev != context->ass->Line.begin() && !predicate(*prev)) ;
|
||||||
|
|
Loading…
Reference in a new issue