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:
John Scipione
2019-02-25 11:57:46 +00:00
committed by Barrett17
parent 5b88998b2d
commit 65c0d507d3
+2 -1
View File
@@ -427,7 +427,7 @@ MidiPlayerWindow::_StopHook(int32 arg)
void void
MidiPlayerWindow::StopHook() MidiPlayerWindow::StopHook()
{ {
Lock(); if (Lock()) {
// we may be called from the synth's thread // we may be called from the synth's thread
fIsPlaying = false; fIsPlaying = false;
@@ -439,6 +439,7 @@ MidiPlayerWindow::StopHook()
Unlock(); Unlock();
} }
}
void void