UI: Fix LogManager closing.

This commit is contained in:
Nodir Temirkhodjaev 2018-12-24 14:27:52 +05:00
parent a24fc5a678
commit bc37a34142
5 changed files with 13 additions and 2 deletions

View File

@ -38,8 +38,6 @@ void DriverManager::setupWorker()
void DriverManager::abortWorker()
{
m_driverWorker->disconnect(this);
m_driverWorker->abort();
}

View File

@ -55,6 +55,8 @@ void DriverWorker::cancelAsyncIo()
void DriverWorker::abort()
{
if (m_aborted) return;
m_aborted = true;
cancelAsyncIo();

View File

@ -136,6 +136,7 @@ void FortManager::closeDriver()
updateLogManager(false);
m_driverManager->closeDevice();
m_logManager->close();
}
void FortManager::setupDatabaseManager()

View File

@ -1,5 +1,7 @@
#include "logmanager.h"
#include <QCoreApplication>
#include "../driver/driverworker.h"
#include "../fortcommon.h"
#include "logbuffer.h"
@ -49,6 +51,13 @@ void LogManager::initialize()
m_appStatModel->initialize();
}
void LogManager::close()
{
QCoreApplication::sendPostedEvents(this);
m_driverWorker->disconnect(this);
}
void LogManager::setupDriverWorker()
{
connect(m_driverWorker, &DriverWorker::readLogResult,

View File

@ -36,6 +36,7 @@ signals:
void errorMessageChanged();
public slots:
void close();
private slots:
void processLogBuffer(LogBuffer *logBuffer, bool success,