(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
authortron
Sat, 03 Sep 2005 17:30:16 +0000
changeset 2385 4c3c35bd93da
parent 2384 543c2a6a81b4
child 2386 c5cc666c869d
(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
--- a/music/dmusic.cpp	Sat Sep 03 12:28:39 2005 +0000
+++ b/music/dmusic.cpp	Sat Sep 03 17:30:16 2005 +0000
@@ -113,20 +113,20 @@
 
 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();
 }