-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.9.3
-
None
When we lately started using Clangs address sanitizer for debugging purposes, our programs now report memory leaks when the exited (see the attached log for details).
There mem leaks are caused as the QFontDatabase destructor is never called on program exit. I copied the code from the destructor to our main function right before exit and the mem leak was gone.
It looks like there is a problem in this piece of code:
QPlatforstd::unique_ptrmFontDatabase *QPlatformIntegration::fontDatabase() const { static QPlatformFontDatabase *db = nullptr; if (!db) { db = new QPlatformFontDatabase; } return db; }
There db will never be deleted - which might be fine for other platforms but for Linux/X11 with fontconfig this causes the mem leaks.
Maybe a std::unique_ptr or a qAddPostRoutine() could help.