From 485881fb7c763c5fce3de264133c72447589b5ad Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Tue, 16 Jun 2009 23:44:06 +0000 Subject: [PATCH] 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. --- aegisub/src/audio_display.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aegisub/src/audio_display.cpp b/aegisub/src/audio_display.cpp index 268f7d2af..de0ea86aa 100644 --- a/aegisub/src/audio_display.cpp +++ b/aegisub/src/audio_display.cpp @@ -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);