From c74903dc8046dd9e1eea4a43e0f6739ae2c7fc08 Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 3 Sep 2005 17:30:16 +0000 Subject: [PATCH] (svn r2911) Deinitialise the DirectMusic driver like it's done in the example code in MSDN, this should fix a strange crash upon deinitialising wave out sound --- music/dmusic.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/music/dmusic.cpp b/music/dmusic.cpp index 9f4f0c10d5..28a43803f8 100644 --- a/music/dmusic.cpp +++ b/music/dmusic.cpp @@ -113,20 +113,20 @@ static const char* DMusicMidiStart(const char* const* parm) static void DMusicMidiStop(void) { - /* release everything but the segment, which the performance - * will release automatically (and it'll crash if it's been - * released already) */ - seeking = false; - loader->Release(); - loader = NULL; + performance->Stop(NULL, NULL, 0, 0); + + segment->SetParam(GUID_Unload, -1, 0, 0, performance); + segment->Release(); + segment = NULL; performance->CloseDown(); performance->Release(); performance = NULL; - segment = NULL; + loader->Release(); + loader = NULL; proc.CoUninitialize(); }