Attempted fix for a runtime error caused by a double free.

main
Jacob Sowder 1 year ago
parent 2c90c930bd
commit 9e3498d43e

@ -211,7 +211,11 @@ strife, chex quest, and fan-created games like harmony, hacx and freedoom.")
(patches (list (search-path
(map (cut string-append <> "/my-packages/patches")
%load-path)
"barony-fix-make-install-script.patch")))))
"barony-fix-make-install-script.patch")
(search-path
(map (cut string-append <> "/my-packages/patches")
%load-path)
"barony-fix-double-free-bug.patch")))))
(build-system cmake-build-system)
(arguments
'(#:configure-flags

@ -0,0 +1,42 @@
diff --git a/src/engine/audio/sound.cpp b/src/engine/audio/sound.cpp
index 08940669..828e075b 100644
--- a/src/engine/audio/sound.cpp
+++ b/src/engine/audio/sound.cpp
@@ -1839,23 +1839,23 @@ void physfsReloadMusic(bool &introMusicChanged, bool reloadAll) //TODO: This sho
OPENAL_Sound_Release(music[c]);
#endif
}
- if ( musicPreload )
- {
- //fmod_result = fmod_system->createSound(musicDir.c_str(), FMOD_2D, nullptr, &music[c]);
+ else if ( musicPreload )
+ {
+ //fmod_result = fmod_system->createSound(musicDir.c_str(), FMOD_2D, nullptr, &music[c]);
physfsReloadMusic_helper_reloadMusicArray(NUMINTROMUSIC, "music/intro%02d.ogg", music, reloadAll);
- }
- else
- {
- //fmod_result = fmod_system->createStream(musicDir.c_str(), FMOD_2D, nullptr, &music[c]);
+ }
+ else
+ {
+ //fmod_result = fmod_system->createStream(musicDir.c_str(), FMOD_2D, nullptr, &music[c]);
physfsReloadMusic_helper_reloadMusicArray(NUMINTROMUSIC, "music/intro%02d.ogg", music, reloadAll);
- }
- introChanged = true;
+ }
+ introChanged = true;
#ifdef USE_FMOD
- if (fmod_result != FMOD_OK)
- {
- printlog("[PhysFS]: ERROR: Failed reloading music file \"%s\".");
- break; //TODO: Handle the error?
- }
+ if (fmod_result != FMOD_OK)
+ {
+ printlog("[PhysFS]: ERROR: Failed reloading music file \"%s\".");
+ break; //TODO: Handle the error?
+ }
#endif
}
}
Loading…
Cancel
Save