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 New Issue