Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop sample previews on mouse release or browser focus loss #5764

Merged
merged 2 commits into from
Nov 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/gui/FileBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@ void FileBrowserTreeWidget::mouseReleaseEvent(QMouseEvent * me )
if (s && s->totalFrames() - s->framesDone() <= second * 3)
{
s->setDoneMayReturnTrue(true);
// TODO: This means we can't interrupt this preview, so if a new one
// starts before this one ends they will overlap. Removing this line
// leads to a crash (see https://github.com/LMMS/lmms/issues/5736)
// right now, but with some fixes to Mixer it should be safe to do.
m_previewPlayHandle = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion

Suggested change
m_previewPlayHandle = NULL;
m_previewPlayHandle = nullptr;

}
else { stopPreview(); }
}
Expand Down