Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.9.1
-
None
Description
An application loads and unloads (this is essential) DLL plugins during its work. Some plugins contain Qt widgets. Some widgets are UI-based forms. If a font is specified in UI that isn't loaded by the app itself and a widget with such UI gets created during app lifetime, app crashes on termination deep inside QGuiApplication destructor (during QWindowsFontEngine destruction, to be more precise).
It seems that QStringLiteral-s generated in ui_*.h code create QString-s that reference DLL memory, and unloading DLL invalidates that memory. Because QString-s are copy-on-write, a QString stored inside QWindowsFontEngine never gets deep-copied, which leads to crash when trying to access QString data after the DLL gets unloaded.
I've attached an example which demonstrates the problem. Didn't try that on platforms other than Windows.
Attachments
Issue Links
- is duplicated by
-
QTBUG-49061 QString static finalization SEGFAULT with use of QStringLiteral
- Closed
-
QTBUG-51602 Don't generate code using QStringLiteral as this can create a problem if the code is used in a DLL
- Closed