fix: exit error bug.

This commit is contained in:
2025-06-19 17:01:25 +08:00
parent dfc2639746
commit 5890b66309
7 changed files with 24 additions and 13 deletions

View File

@@ -8,7 +8,6 @@
#include "Control/LogControl.h"
static LogPrint* logPrint = nullptr;
static QMutex logMut;
frelayGUI::frelayGUI(QWidget* parent) : QMainWindow(parent), ui(new Ui::frelayGUI)
{
@@ -28,9 +27,7 @@ frelayGUI::frelayGUI(QWidget* parent) : QMainWindow(parent), ui(new Ui::frelayGU
frelayGUI::~frelayGUI()
{
QMutexLocker locker(&logMut);
delete ui;
logPrint = nullptr;
}
void frelayGUI::InitControl()
@@ -93,9 +90,7 @@ void frelayGUI::ControlMsgHander(QtMsgType type, const QMessageLogContext& conte
{
Q_UNUSED(context);
QMutexLocker locker(&logMut);
if (!logPrint) {
if (!qApp || !qobject_cast<frelayGUI*>(qApp->activeWindow())) {
return;
}