diff --git a/src/duckstation-qt/logwindow.cpp b/src/duckstation-qt/logwindow.cpp index 514346de0..7b7831e9c 100644 --- a/src/duckstation-qt/logwindow.cpp +++ b/src/duckstation-qt/logwindow.cpp @@ -59,6 +59,7 @@ void LogWindow::updateSettings() } else if (g_log_window) { + g_log_window->m_destroying = true; g_log_window->close(); g_log_window->deleteLater(); g_log_window = nullptr; @@ -70,6 +71,7 @@ void LogWindow::destroy() if (!g_log_window) return; + g_log_window->m_destroying = true; g_log_window->close(); g_log_window->deleteLater(); g_log_window = nullptr; @@ -306,6 +308,12 @@ void LogWindow::logCallback(void* pUserParam, const char* channelName, const cha void LogWindow::closeEvent(QCloseEvent* event) { + if (!m_destroying) + { + event->ignore(); + return; + } + Log::UnregisterCallback(&LogWindow::logCallback, this); saveSize(); diff --git a/src/duckstation-qt/logwindow.h b/src/duckstation-qt/logwindow.h index e9d3b0efc..d6054d940 100644 --- a/src/duckstation-qt/logwindow.h +++ b/src/duckstation-qt/logwindow.h @@ -55,6 +55,7 @@ private: std::span m_filter_names; bool m_attached_to_main_window = true; + bool m_destroying = false; }; extern LogWindow* g_log_window;