diff options
author | tron <tron@openttd.org> | 2005-09-03 17:30:16 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-09-03 17:30:16 +0000 |
commit | c74903dc8046dd9e1eea4a43e0f6739ae2c7fc08 (patch) | |
tree | 88583e8e2cfd6f6bede0b4a63d277f72466efc21 /music | |
parent | 4c47773603ca3d446f2cc001058f7025e3d1cfaf (diff) | |
download | openttd-c74903dc8046dd9e1eea4a43e0f6739ae2c7fc08.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.cpp | 14 |
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(); } |