Skip to content

Commit

Permalink
fix build error, terminate qprocess instead of close() it in Processo…
Browse files Browse the repository at this point in the history
…r destructor
  • Loading branch information
w0lek committed Nov 16, 2023
1 parent 7d0848e commit bd2dbb1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/InteractivePathAnalysis/client/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Process::Process(const QString& name)

Process::~Process()
{
qInfo() << "~~~ ~Process() START";
qDebug() << "~~~ ~Process() START";
m_watcherTimer.stop();
close();
terminate();
if (!waitForFinished(PROCESS_FINISH_TIMOUT_MS)) {
kill();
waitForFinished();
}
qInfo() << "~~~ ~Process() END";
qDebug() << "~~~ ~Process() END";
}

void Process::start(const QString& fullCmd)
Expand Down
4 changes: 2 additions & 2 deletions src/InteractivePathAnalysis/client/tcpsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TcpSocket::TcpSocket()

QObject::connect(&m_socket, &QAbstractSocket::stateChanged, this, &TcpSocket::handleStateChanged);
QObject::connect(&m_socket, &QIODevice::readyRead, this, &TcpSocket::handleDataReady);
QObject::connect(&m_socket, &QTcpSocket::errorOccurred, this, &TcpSocket::handleSocketError);
QObject::connect(&m_socket, qOverload<QAbstractSocket::SocketError>(&QAbstractSocket::error), this, &TcpSocket::handleError);
}

TcpSocket::~TcpSocket()
Expand Down Expand Up @@ -79,7 +79,7 @@ void TcpSocket::handleDataReady()
}
}

void TcpSocket::handleSocketError(QAbstractSocket::SocketError)
void TcpSocket::handleError(QAbstractSocket::SocketError)
{
m_bytesBuf.clear();
qDebug() << m_socket.errorString();
Expand Down
2 changes: 1 addition & 1 deletion src/InteractivePathAnalysis/client/tcpsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ class TcpSocket : public QObject {
private slots:
void handleStateChanged(QAbstractSocket::SocketState);
void handleDataReady();
void handleSocketError(QAbstractSocket::SocketError);
void handleError(QAbstractSocket::SocketError);
};

0 comments on commit bd2dbb1

Please sign in to comment.