Fix memory leaks in test code of tst_qabstracthttpserver


Create QTcpServer objects in stack rather than in the heap to simplify memory ownership.
Normally QTcpServer created in the heap is not leaking, because it becomes a child of QAbstractHttpServer in QAbstractHttpServer.bind(). However parenting does not happen if bind() fails. So QTcpServer objects were leaking in tests where bind() was supposed to fail.
As the simplest fix, it was decided to create those QTcpServer objects in the stack.

Change-Id: I19788dff4c55deacf242be03871512c9c86296de
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
commite7c4bb0f4f2719066abe0fe82525e16fa2bcbc50
parentd124fe97866969848ee5bba1d36748145f3a4ef3
authorYuri Knigavko <yuri.knigavko@qt.io>
committerYuri Knigavko <yuri.knigavko@qt.io>
commit timeFri, 11 Oct 2024 16:17:32 +0200