Thanks for answering,
Well apart for the misleading m_ at the beginning that variable is non memeber,
what I do is call this method whenever I have to send a message to a TcpServer
void QSendAlarm::SendEndAlarm()
{
bool ret;
mySocket.connectToHost("127.0.0.1", 740);
ret=mySocket.waitForConnected();
mySocket.disconnectFromHost();
ret=mySocket.waitForDisconnected();
se=mySocket.error();
mySocket.abort();
mySocket.close();
}
void QSendAlarm::SendEndAlarm()
{
bool ret;
QTcpSocket mySocket;
mySocket.connectToHost("127.0.0.1", 740);
ret=mySocket.waitForConnected();
mySocket.disconnectFromHost();
ret=mySocket.waitForDisconnected();
QAbstractSocket::SocketError se;
se=mySocket.error();
mySocket.abort();
mySocket.close();
}
To copy to clipboard, switch view to plain text mode
So the variable goes out of scope everytime, but the handles increase everytime I call connectToHost, is that a leak or I'm missing something?
Thanks again
bye
Bookmarks