Merge pull request #461 from TwilitRealm/26-04-21-thp-shutdown-crash

Fix THP shutdown crash
This commit is contained in:
TakaRikka
2026-04-20 18:45:29 -07:00
committed by GitHub
3 changed files with 20 additions and 1 deletions
+6
View File
@@ -94,6 +94,12 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
#define THP_TEXTURE_SET_COUNT 3
#endif
#if TARGET_PC
namespace dusk {
void MoviePlayerShutdown();
}
#endif
struct daMP_THPPlayer {
/* 0x000 */ DVDFileInfo fileInfo;
/* 0x03C */ THPHeader header;
+9
View File
@@ -4580,3 +4580,12 @@ actor_process_profile_definition g_profile_MOVIE_PLAYER = {
};
AUDIO_INSTANCES;
#if TARGET_PC
void dusk::MoviePlayerShutdown() {
// We need to cleanly shut down the threads to avoid crashes on shutdown.
if (daMP_c::m_myObj) {
daMP_c::m_myObj->daMP_c_Finish();
}
}
#endif
+5 -1
View File
@@ -66,13 +66,15 @@
#include "SDL3/SDL_filesystem.h"
#include "cxxopts.hpp"
#include "d/actor/d_a_movie_player.h"
#include "dusk/audio/DuskAudioSystem.h"
#include "dusk/config.hpp"
#include "dusk/settings.h"
#include "dusk/imgui/ImGuiConsole.hpp"
#include "dusk/settings.h"
#include "dusk/discord_presence.hpp"
#include "tracy/Tracy.hpp"
#include "f_pc/f_pc_draw.h"
#include "tracy/Tracy.hpp"
// --- GLOBALS ---
s8 mDoMain::developmentMode = -1;
@@ -614,6 +616,8 @@ int game_main(int argc, char* argv[]) {
main01();
dusk::MoviePlayerShutdown();
dusk::ShutdownCrashReporting();
dusk::ShutdownFileLogging();
fflush(stdout);