mirror of https://github.com/qt/qthttpserver.git
Fix memory leak in test
QTcpSocket was created on heap without a parent and it never called delete. Change-Id: I492633f9797427e546065f9afadf19a672dc552c Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
93ff67a3fc
commit
68a4458a7b
|
@ -258,11 +258,11 @@ void tst_QAbstractHttpServer::qtbug82053()
|
|||
tcpServer->listen();
|
||||
server.bind(tcpServer);
|
||||
|
||||
auto client = new QTcpSocket;
|
||||
client->connectToHost(QHostAddress::LocalHost, tcpServer->serverPort());
|
||||
client->waitForConnected();
|
||||
client->write("CONNECT / HTTP/1.1\n\n");
|
||||
client->waitForBytesWritten();
|
||||
QTcpSocket client;
|
||||
client.connectToHost(QHostAddress::LocalHost, tcpServer->serverPort());
|
||||
client.waitForConnected();
|
||||
client.write("CONNECT / HTTP/1.1\n\n");
|
||||
client.waitForBytesWritten();
|
||||
QTest::qWait(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue