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 8e13869510
commit b90baf0ef4
1 changed files with 6 additions and 1 deletions

View File

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