From 060a6b2ff2b9716eee79f09187f59a41eacda616 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 28 Dec 2015 21:23:21 +0100 Subject: [PATCH] - shut down WildMidi when exiting. The pointless error message in WildMidi_Shutdown was removed to keep the rest of the code simple and allowing to call this even when the device never was used. --- src/sound/i_music.cpp | 1 + src/wildmidi/wildmidi_lib.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sound/i_music.cpp b/src/sound/i_music.cpp index 3f8fac0da6..721be51920 100644 --- a/src/sound/i_music.cpp +++ b/src/sound/i_music.cpp @@ -189,6 +189,7 @@ void I_ShutdownMusic(void) assert (currSong == NULL); } Timidity::FreeAll(); + WildMidi_Shutdown(); #ifdef _WIN32 I_ShutdownMusicWin32(); #endif // _WIN32 diff --git a/src/wildmidi/wildmidi_lib.cpp b/src/wildmidi/wildmidi_lib.cpp index 84c2f382ac..b5ea6b8877 100644 --- a/src/wildmidi/wildmidi_lib.cpp +++ b/src/wildmidi/wildmidi_lib.cpp @@ -4261,8 +4261,8 @@ WildMidi_GetInfo(midi * handle) { WM_SYMBOL int WildMidi_Shutdown(void) { if (!WM_Initialized) { - _WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0); - return -1; + // No error if trying to shut down an uninitialized device. + return 0; } while (first_handle) { /* closes open handle and rotates the handles list. */