Fixed uninited variable causing exception

Originally committed to SVN as r730.
This commit is contained in:
Niels Martin Hansen 2007-01-07 03:19:48 +00:00
parent 064db890eb
commit d0a7745d41
1 changed files with 5 additions and 2 deletions

View File

@ -63,6 +63,7 @@ DirectSoundPlayer::DirectSoundPlayer() {
directSound = NULL; directSound = NULL;
thread = NULL; thread = NULL;
threadRunning = false; threadRunning = false;
notificationEvent = NULL;
} }
@ -222,6 +223,7 @@ void DirectSoundPlayer::Play(__int64 start,__int64 count) {
buffer->Stop(); buffer->Stop();
// Create notification event // Create notification event
if (notificationEvent)
CloseHandle(notificationEvent); CloseHandle(notificationEvent);
notificationEvent = CreateEvent(NULL,false,false,NULL); notificationEvent = CreateEvent(NULL,false,false,NULL);
@ -293,6 +295,7 @@ void DirectSoundPlayer::Stop(bool timerToo) {
offset = 0; offset = 0;
// Close event handle // Close event handle
if (notificationEvent)
CloseHandle(notificationEvent); CloseHandle(notificationEvent);
// Stop timer // Stop timer