mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
LogManager: Check if listener is valid before using it
This commit is contained in:
parent
a2ad3e14d0
commit
dd8dcdf880
@ -164,6 +164,7 @@ void LogManager::LogWithFullPath(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE
|
||||
LogTypes::LOG_LEVEL_TO_CHAR[(int)level], log->GetShortName().c_str(), temp);
|
||||
|
||||
for (auto listener_id : *log)
|
||||
if (m_listeners[listener_id])
|
||||
m_listeners[listener_id]->Log(level, msg.c_str());
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class LogManager : NonCopyable
|
||||
private:
|
||||
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
|
||||
static LogManager* m_logManager; // Singleton. Ugh.
|
||||
std::array<LogListener*, LogListener::NUMBER_OF_LISTENERS> m_listeners;
|
||||
std::array<LogListener*, LogListener::NUMBER_OF_LISTENERS> m_listeners{};
|
||||
size_t m_path_cutoff_point = 0;
|
||||
|
||||
LogManager();
|
||||
|
Loading…
x
Reference in New Issue
Block a user