mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 21:28:51 +00: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:
parent
b566e81644
commit
c8be819711
4 changed files with 39 additions and 24 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue