Fix crash when using large number of different fonts


QCDistanceFieldGlyphCache keeps a QCRhiDistanceFieldGlyphCache for
every font used. QCRhiDistanceFieldGlyphCache would keep a
QRhiResourceUpdateBatch allocated at all times. However the
number of update batches has a hard limit of 64 for the whole
QRhi instance, and nextResourceUpdateBatch() will return nullptr
if this limit is exeeded. This patch does two things:
1. Add nullptr guards to avoid crashing if m_batch is nullptr.
2. Allocate m_batch lazily instead of in the constructor.

Pick-to: 6.12
Change-Id: Ie96d553c8250917f7bd4adce2f30fc0fd4f7732b
Reviewed-by: Owais Akhtar <owais.akhtar@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commitdddca0d8863e2f266d5138acb4e32f296feb8baa
parent290a6ea43edbe67de7a85555f12de3f274f42656
authorPaul Olav Tvete <paul.tvete@qt.io>
committerPaul Olav Tvete <paul.tvete@qt.io>
commit timeMon, 27 Jul 2026 08:15:52 +0000