aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2015-04-29 23:42:01 -0400
committerMatthew Hoops2015-07-07 20:19:46 -0400
commitdce05c520b2e1f273f395c986573f532ee698921 (patch)
tree034c6f504cd14b9adae43fdf721c3a8426a45c16
parentb367ea548d7c129e14fec6164ebe5610d3edeb46 (diff)
downloadscummvm-rg350-dce05c520b2e1f273f395c986573f532ee698921.tar.gz
scummvm-rg350-dce05c520b2e1f273f395c986573f532ee698921.tar.bz2
scummvm-rg350-dce05c520b2e1f273f395c986573f532ee698921.zip
AUDIO: Be consistent with calling stop() in OPL destructors
-rw-r--r--audio/fmopl.cpp6
-rw-r--r--audio/softsynth/opl/dosbox.cpp2
-rw-r--r--audio/softsynth/opl/mame.cpp2
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;
}