summaryrefslogtreecommitdiff
path: root/music
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-09-03 17:30:16 +0000
committertron <tron@openttd.org>2005-09-03 17:30:16 +0000
commit3ace3769c9316c7ab00aa31d42ac6d7c2db5e330 (patch)
tree88583e8e2cfd6f6bede0b4a63d277f72466efc21 /music
parent3dd2dab7e9aef15753e961a0ab9dce43dffe35ca (diff)
downloadopenttd-3ace3769c9316c7ab00aa31d42ac6d7c2db5e330.tar.xz
(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
Diffstat (limited to 'music')
-rw-r--r--music/dmusic.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/music/dmusic.cpp b/music/dmusic.cpp
index 9f4f0c10d..28a43803f 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();
}