Fix #885, for some reason mouse events were firing in the audio display while some internal variables were invalid. Now mouse events are skipped if the display is missing a player or provider.

Originally committed to SVN as r3068.
This commit is contained in:
Niels Martin Hansen 2009-06-16 23:44:06 +00:00
parent 7654458b0f
commit 485881fb7c

View file

@ -1372,6 +1372,11 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
return; return;
} }
if (!player || !provider) {
event.Skip();
return;
}
// Is inside? // Is inside?
bool inside = false; bool inside = false;
bool onScale = false; bool onScale = false;
@ -1434,7 +1439,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
} }
// Cursor drawing // Cursor drawing
if (!player->IsPlaying() && origImage) { if (player && !player->IsPlaying() && origImage) {
// Draw bg // Draw bg
wxClientDC dc(this); wxClientDC dc(this);
dc.DrawBitmap(*origImage,0,0); dc.DrawBitmap(*origImage,0,0);