Linguist: MainWindow: fix Coverity BAD_FREE in editPhaseBook()


Coverity complained that PhraseBookBox (a QDialog) was created on the
stack and exec() could delete it.

The False Positive triage in Coverity UI is wrong: This is Coverity's
roundabout way of pointing out that the decades-old¹ stack-allocated
dialog antipattern is active here.

¹ https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0/

Apply the usual fix: hold the dialog in QAutoPointer, so it's not
deleted twice.

Also guard the updatePhraseDicts() call from a nullptr `this`, which
would crash (technically: UB) if called on a deleted mainwindow.

Amends the start of the public history in this module.

Pick-to: 6.12 6.8
Coverity-Id: 218688
Change-Id: I3049dd53b25f4231aa8fca8334010c8164813372
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
commit8c09a89276e5451b11f70de12b0e35db53bc87e1
parent018054fa01d6e0d5f22aeeaf51ef23c1f1d1a954
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeWed, 30 Sep 2026 08:13:55 +0000