Fuzzing: Explicitly clean up the font system


This seems to avoid the memory leaks a static QGuiApplication causes on
shutdown. Credit to Joerg Bornemann for proposing the workaround.

Written this way, the cleanup happens after every single tested input. I
also tried calling cleanup() from the dtor of a static helper object
which would clean up only once, but that would not avoid the issue
reliably. The helper object would be constructed when handling the first
input but the font system might be initialized later, when it's actually
being used. As a result, the call to cleanup() would happen too late.
Anyway, the static helper didn't seem to improve the fuzzer's speed
significantly.

Task-number: QTBUG-140076
Change-Id: I967249d827a88c7dacfc5f431e178a41cb56b630
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
commitfd3fe50abf00869025ad82ee388633a0d4eb12bb
parent4717eca72ad5e3b99898ecce55e8b1830e74dc98
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeMon, 20 Apr 2026 05:27:02 +0000