qtlanguageserver: avoid potential double-free or use-after-free


RequestBatchHandler::processMessages() incremented a pending-request
counter and deleted itself once the counter reached zero. A handler that
resolves syncronously could hit delete to fire before dispatching had
actually finished. This could either lead to double-free or
use-after-free depending on the size of the batch.

Add a "dispatch done" guard so the object is only deleted once, and
only after the dispatch loop has fully completed.

Pick-to: 6.12
Fixes: QTBUG-148484
Change-Id: I2a4ffa488619feb84595d74bf76be408fc32dd18
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
commite5f8ae5ff8f71235ffefb0ffe2e5d02f4ac1001e
parentea6f465fa4bdbe5aa7f9347e794b8e345a464e4c
authorSemih Yavuz <semih.yavuz@qt.io>
committerSemih Yavuz <semih.yavuz@qt.io>
commit timeThu, 6 Aug 2026 09:44:00 +0000