summaryrefslogtreecommitdiff
path: root/src/music/dmusic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/music/dmusic.cpp')
-rw-r--r--src/music/dmusic.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp
index cb255e7c0..152bbb249 100644
--- a/src/music/dmusic.cpp
+++ b/src/music/dmusic.cpp
@@ -82,24 +82,16 @@ const char *MusicDriver_DMusic::Start(const char * const *parm)
IID_IDirectMusicPerformance,
(LPVOID*)&performance
))) {
- proc.CoUninitialize();
return "Failed to create the performance object";
}
/* initialize it */
if (FAILED(performance->Init(NULL, NULL, NULL))) {
- performance->Release();
- performance = NULL;
- proc.CoUninitialize();
return "Failed to initialize performance object";
}
/* choose default Windows synth */
if (FAILED(performance->AddPort(NULL))) {
- performance->CloseDown();
- performance->Release();
- performance = NULL;
- proc.CoUninitialize();
return "AddPort failed";
}
@@ -111,10 +103,6 @@ const char *MusicDriver_DMusic::Start(const char * const *parm)
IID_IDirectMusicLoader,
(LPVOID*)&loader
))) {
- performance->CloseDown();
- performance->Release();
- performance = NULL;
- proc.CoUninitialize();
return "Failed to create loader object";
}
@@ -122,6 +110,12 @@ const char *MusicDriver_DMusic::Start(const char * const *parm)
}
+MusicDriver_DMusic::~MusicDriver_DMusic()
+{
+ this->Stop();
+}
+
+
void MusicDriver_DMusic::Stop()
{
seeking = false;