aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-09-03 18:59:02 +0000
committerTorbjörn Andersson2003-09-03 18:59:02 +0000
commita1e336c1cbb134dc4a6932226dd9fc9fb28bf1ab (patch)
treeb11715a5e23cf2743bb410f80285e4fb6140bbe7 /sword2/driver
parent94df02c799c5ef59ecd9c829b43a5d41f9fb3e2e (diff)
downloadscummvm-rg350-a1e336c1cbb134dc4a6932226dd9fc9fb28bf1ab.tar.gz
scummvm-rg350-a1e336c1cbb134dc4a6932226dd9fc9fb28bf1ab.tar.bz2
scummvm-rg350-a1e336c1cbb134dc4a6932226dd9fc9fb28bf1ab.zip
Added FIXME comment about how we probably need locking for FxServer() and
the functions which access data manipulated by FxServer(). For instance, FxServer() may free bufferFx[i], which sounds potentially unhealthy to me. svn-id: r9989
Diffstat (limited to 'sword2/driver')
-rw-r--r--sword2/driver/d_sound.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index c86da67869..bf79752aee 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -301,6 +301,14 @@ int32 Sword2Sound::IsFxOpen(int32 id) {
// a slow timer from rdwin.c
// --------------------------------------------------------------------------
void Sword2Sound::FxServer(void) {
+ // FIXME: This function is called from a separate thread, and
+ // manipulates data structures that are used by several other
+ // functions throughout the file.
+ //
+ // I guess that means we need to add locking and stuff.
+ //
+ // Maybe that explains why BS2 still crashes every now and then.
+
int i;
if (!soundOn)
@@ -318,7 +326,7 @@ void Sword2Sound::FxServer(void) {
fxId[i] = 0;
if (bufferFx[i] != NULL) {
free(bufferFx[i]);
- bufferFx[i] = NULL;
+ bufferFx[i] = NULL;
}
bufferSizeFx[i] = 0;
flagsFx[i] = 0;