我在我的 Qt/C++ 程序上运行 valgrind 并收到此错误:
Invalid read of size 8
in TelnetConnection::disconnectClient() in telnetserver/telnetconnection.cpp:188
第 188 行是下面的 waitForDisconnected 行:
void TelnetConnection::disconnectClient()
{
tcpSocketPtr->disconnectFromHost();
tcpSocketPtr->waitForDisconnected();
}
我不完全确定这个错误意味着什么,但我该如何解决这个问题?或者这是我无法控制的?(一个Qt问题)?
我不确定它是否相关,但我得到的唯一其他错误是:
384 bytes in 1 blocks are possibly lost in loss record 5,342 of 5,972
in TelnetServer::incomingConnection(long long) in telnetserver/telnetserver.cpp:22
错误行是下面的 Start():
void TelnetServer::incomingConnection(qintptr socketDescriptor)
{
TelnetConnection *thread = new TelnetConnection(socketDescriptor, this);
connect(thread, SIGNAL(shutdownRequested()), m_controller, SLOT(shutdownCommandIssued()));
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
connect(m_controller, SIGNAL(shutingdown()), thread, SLOT(shutdownConnection()));
thread->start();
}
再次......这个启动功能如何导致内存泄漏?或者“可能丢失”这句话是否意味着它实际上没问题?