mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
libretro: Fix logging breaking when retro_set_environment called twice
This commit is contained in:
parent
282f166e7a
commit
3ad780b52e
|
@ -63,13 +63,12 @@ LibretroHostInterface::~LibretroHostInterface()
|
|||
|
||||
void LibretroHostInterface::InitLogging()
|
||||
{
|
||||
if (s_libretro_log_callback_registered)
|
||||
return;
|
||||
|
||||
s_libretro_log_callback_valid =
|
||||
g_retro_environment_callback(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &s_libretro_log_callback);
|
||||
if (s_libretro_log_callback_registered)
|
||||
{
|
||||
Log::UnregisterCallback(LibretroLogCallback, nullptr);
|
||||
s_libretro_log_callback_registered = false;
|
||||
}
|
||||
|
||||
if (s_libretro_log_callback_valid)
|
||||
{
|
||||
Log::RegisterCallback(LibretroLogCallback, nullptr);
|
||||
|
|
Loading…
Reference in a new issue