diff --git a/src/common/log.c b/src/common/log.c index 307f5fb..0651a74 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -173,7 +173,7 @@ void log_error_callback_set(Log_Error_CB callback) } void log_message_callback_stub(const char* message, va_list args) -{ +{ // This is just a stub in-case no callback has been set } @@ -183,6 +183,13 @@ void log_warning_callback_stub(const char* warning_message, va_list args) } void log_error_callback_stub(const char* context, const char* message, va_list args) -{ - // This is just a stub in-case no callback has been set -} \ No newline at end of file +{ + // This is just a stub in-case no callback has been set +} + +void log_reset_all_callbacks(void) +{ + message_callback = log_message_callback_stub; + warning_callback = log_warning_callback_stub; + error_callback = log_error_callback_stub; +} diff --git a/src/common/log.h b/src/common/log.h index 4e9250f..0515484 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -20,5 +20,6 @@ void log_file_handle_set(FILE* file); void log_message_callback_set(Log_Message_CB callback); void log_warning_callback_set(Log_Warning_CB callback); void log_error_callback_set(Log_Error_CB callback); +void log_reset_all_callbacks(void); #endif diff --git a/src/game/main.c b/src/game/main.c index 9658494..307852c 100644 --- a/src/game/main.c +++ b/src/game/main.c @@ -278,6 +278,7 @@ void cleanup(void) if(game.cleanup) game.cleanup(); if(game_lib_handle) platform_unload_library(game_lib_handle); if(window) window_destroy(window); + log_reset_all_callbacks(); // Now that the game library has been unloaded, reset all callbacks to stubs so we don't crash on exit sound_cleanup(); platform_unload_gl(); platform_cleanup(); @@ -301,7 +302,7 @@ bool game_lib_load(void) return false; } - game_lib_handle = platform_load_library("libSymmetry.copy"); + game_lib_handle = platform_load_library("Symmetry_Game.copy"); #else game_lib_handle = platform_load_library("Symmetry_Game"); #endif