Ensure route in test does not capture references to variables on stack


Make the test tst_QHttpServer::checkRouteLambdaCapture(), which adds two
new routes that capture references on the stack, capture by reference to
class member variable once instead. There is no reason to do the same
test twice.

The potential use after return in the test was discovered by the address
sanitizer, though the route is not used outside of this test.

Fixes: QTBUG-144180
Change-Id: If3c1bfacc706004ed13171c71dd7a182064ce3d7
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
commit3d4d762c54b882c280bb207d117fe5e8e948ff92
parent6bf07df161bc35ea4660a0c28c45c910ba976aa5
authorØystein Heskestad <oystein.heskestad@qt.io>
committerØystein Heskestad <oystein.heskestad@qt.io>
commit timeMon, 16 Feb 2026 12:54:12 +0100