Skip to content

Commit

Permalink
[Qt/mainfilter] Fix crash on closing filter preview and filter manage…
Browse files Browse the repository at this point in the history
…r in quick succession

Hitting the ESC key twice to close both filter preview and filter manager
could result in the second rejected() signal received by the preview
which was already removed from widget stack and subsequent assert
failure in qtUnregisterDialog(). This was especially easy to reproduce
during playback.

This patch avoids the crash by suppressing subsequent signals from filter
preview dialog. If ESC is pressed the second time too soon, the keypress
event is ignored which is not perfect but better than a crash.
  • Loading branch information
eumagga0x2a committed Jul 26, 2021
1 parent 5ceb0a0 commit 1475d54
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ void filtermainWindow::closePreview()
{
if(previewDialog->seekablePreview)
{
previewDialog->blockSignals(true); // we crash when this slot is invoked more than once
previewDialog->seekablePreview->play(false);
previewDialog->seekablePreview->goToTime(0);
}
Expand Down

0 comments on commit 1475d54

Please sign in to comment.