Make sure we don't leak the QPlatformFontDatabase using smart pointers

Found it when running KWin on ASAN
This commit is contained in:
Aleix Pol 2020-07-27 19:53:08 +02:00 committed by Aleix Pol Gonzalez
parent e15004ff98
commit 02fc40fa4a
2 changed files with 2 additions and 2 deletions

View file

@ -141,7 +141,7 @@ QPlatformOffscreenSurface *Integration::createPlatformOffscreenSurface(QOffscree
QPlatformFontDatabase *Integration::fontDatabase() const
{
return m_fontDb;
return m_fontDb.data();
}
QPlatformTheme *Integration::createPlatformTheme(const QString &name) const

View file

@ -58,7 +58,7 @@ public:
private:
void initScreens();
QPlatformFontDatabase *m_fontDb;
QScopedPointer<QPlatformFontDatabase> m_fontDb;
QPlatformNativeInterface *m_nativeInterface;
Screen *m_dummyScreen = nullptr;
QScopedPointer<QPlatformInputContext> m_inputContext;