refactor: Properly disconnect and clean up previous daemon file tail on connection
This commit is contained in:
parent
1c7adf5add
commit
dc6383d593
1 changed files with 5 additions and 0 deletions
|
|
@ -235,6 +235,11 @@ void CoreProcess::daemonIpcClientConnected()
|
||||||
|
|
||||||
const auto logPath = requestDaemonLogPath();
|
const auto logPath = requestDaemonLogPath();
|
||||||
if (!logPath.isEmpty()) {
|
if (!logPath.isEmpty()) {
|
||||||
|
if (m_daemonFileTail != nullptr) {
|
||||||
|
disconnect(m_daemonFileTail, &FileTail::newLine, this, &CoreProcess::handleLogLines);
|
||||||
|
m_daemonFileTail->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
qInfo() << "daemon log path:" << logPath;
|
qInfo() << "daemon log path:" << logPath;
|
||||||
m_daemonFileTail = new FileTail(logPath, this);
|
m_daemonFileTail = new FileTail(logPath, this);
|
||||||
connect(m_daemonFileTail, &FileTail::newLine, this, &CoreProcess::handleLogLines);
|
connect(m_daemonFileTail, &FileTail::newLine, this, &CoreProcess::handleLogLines);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue