MidiPlayer: Fix crash when dropping a midi file
Window must be locked or MidiRunThread crashes with a segment violation. Change-Id: I9d5d0fa477475a9b5ba877aea3d6583690aacb2b Reviewed-on: https://review.haiku-os.org/c/1080 Reviewed-by: Barrett17 <[email protected]>
This commit is contained in:
@@ -427,17 +427,18 @@ MidiPlayerWindow::_StopHook(int32 arg)
|
||||
void
|
||||
MidiPlayerWindow::StopHook()
|
||||
{
|
||||
Lock();
|
||||
if (Lock()) {
|
||||
// we may be called from the synth's thread
|
||||
|
||||
fIsPlaying = false;
|
||||
fIsPlaying = false;
|
||||
|
||||
fScopeView->SetPlaying(false);
|
||||
fScopeView->Invalidate();
|
||||
fPlayButton->SetEnabled(true);
|
||||
fPlayButton->SetLabel(B_TRANSLATE("Play"));
|
||||
fScopeView->SetPlaying(false);
|
||||
fScopeView->Invalidate();
|
||||
fPlayButton->SetEnabled(true);
|
||||
fPlayButton->SetLabel(B_TRANSLATE("Play"));
|
||||
|
||||
Unlock();
|
||||
Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user