diff options
-rw-r--r-- | audio/fmopl.cpp | 6 | ||||
-rw-r--r-- | audio/softsynth/opl/dosbox.cpp | 2 | ||||
-rw-r--r-- | audio/softsynth/opl/mame.cpp | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/audio/fmopl.cpp b/audio/fmopl.cpp index 07c5b44427..638da6c224 100644 --- a/audio/fmopl.cpp +++ b/audio/fmopl.cpp @@ -201,8 +201,10 @@ EmulatedOPL::EmulatedOPL() : EmulatedOPL::~EmulatedOPL() { // Stop callbacks, just in case. If it's still playing at this - // point, there's probably a bigger issue, though. - stopCallbacks(); + // point, there's probably a bigger issue, though. The subclass + // needs to call stop() or the pointer can still use be used in + // the mixer thread at the same time. + stop(); } int EmulatedOPL::readBuffer(int16 *buffer, const int numSamples) { diff --git a/audio/softsynth/opl/dosbox.cpp b/audio/softsynth/opl/dosbox.cpp index 09200c7c8d..6e8b4a94ed 100644 --- a/audio/softsynth/opl/dosbox.cpp +++ b/audio/softsynth/opl/dosbox.cpp @@ -149,11 +149,11 @@ OPL::OPL(Config::OplType type) : _type(type), _rate(0), _emulator(0) { } OPL::~OPL() { + stop(); free(); } void OPL::free() { - stopCallbacks(); delete _emulator; _emulator = 0; } diff --git a/audio/softsynth/opl/mame.cpp b/audio/softsynth/opl/mame.cpp index fe23d300fa..d43f638496 100644 --- a/audio/softsynth/opl/mame.cpp +++ b/audio/softsynth/opl/mame.cpp @@ -48,7 +48,7 @@ namespace OPL { namespace MAME { OPL::~OPL() { - stopCallbacks(); + stop(); MAME::OPLDestroy(_opl); _opl = 0; } |