mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
LogManager: Stop using manual memory management
This fixes a memory leak that would occur when the Android frontend calls LogManager::Init more than once in order to reload settings. Note that the log window listener is now owned by LogManager instead of by the frontend, making it consistent with the other log listeners.
This commit is contained in:
@ -52,15 +52,16 @@ LogWidget::LogWidget(QWidget* parent) : QDockWidget(parent), m_timer(new QTimer(
|
||||
|
||||
connect(&Settings::Instance(), &Settings::DebugFontChanged, this, &LogWidget::UpdateFont);
|
||||
|
||||
Common::Log::LogManager::GetInstance()->RegisterListener(LogListener::LOG_WINDOW_LISTENER, this);
|
||||
Common::Log::LogManager::GetInstance()->RegisterListener(
|
||||
Common::Log::LogListener::LOG_WINDOW_LISTENER, std::make_unique<LogListenerImpl>(this));
|
||||
}
|
||||
|
||||
LogWidget::~LogWidget()
|
||||
{
|
||||
SaveSettings();
|
||||
|
||||
Common::Log::LogManager::GetInstance()->RegisterListener(LogListener::LOG_WINDOW_LISTENER,
|
||||
nullptr);
|
||||
Common::Log::LogManager::GetInstance()->RegisterListener(
|
||||
Common::Log::LogListener::LOG_WINDOW_LISTENER, nullptr);
|
||||
}
|
||||
|
||||
void LogWidget::UpdateLog()
|
||||
|
Reference in New Issue
Block a user