refactor: Properly disconnect and clean up previous daemon file tail on connection

This commit is contained in:
Nick Bolton
2025-02-10 17:59:59 +00:00
parent 1c7adf5add
commit dc6383d593

View File

@ -235,6 +235,11 @@ void CoreProcess::daemonIpcClientConnected()
const auto logPath = requestDaemonLogPath();
if (!logPath.isEmpty()) {
if (m_daemonFileTail != nullptr) {
disconnect(m_daemonFileTail, &FileTail::newLine, this, &CoreProcess::handleLogLines);
m_daemonFileTail->deleteLater();
}
qInfo() << "daemon log path:" << logPath;
m_daemonFileTail = new FileTail(logPath, this);
connect(m_daemonFileTail, &FileTail::newLine, this, &CoreProcess::handleLogLines);