diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-07-30 16:15:58 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-07-31 13:11:26 +0000 |
commit | 6aee3cc65289e01094593c83b9180cf76c548ef7 (patch) | |
tree | eb5c50609249ad489069d9704effd260d34edd25 | |
parent | dc7f59d5025b977117e6a61e30c892d0cad7dff7 (diff) |
Fix memory leak in QSGAdaptationBackendData
This hardly matters since it's a singleton, but it's nice to have things
clean on exit to find real leaks. Also disable copy and assignment for
that class to be tidy.
Change-Id: I89a848fd7b93e348918951de2affd9e396f49eff
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r-- | src/quick/scenegraph/qsgcontextplugin.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index 628619fa46..66add51c55 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -73,6 +73,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, struct QSGAdaptationBackendData { QSGAdaptationBackendData(); + ~QSGAdaptationBackendData(); + Q_DISABLE_COPY(QSGAdaptationBackendData) bool tried = false; QSGContextFactoryInterface *factory = nullptr; @@ -91,6 +93,11 @@ QSGAdaptationBackendData::QSGAdaptationBackendData() builtIns.append(new QSGSoftwareAdaptation); } +QSGAdaptationBackendData::~QSGAdaptationBackendData() +{ + qDeleteAll(builtIns); +} + Q_GLOBAL_STATIC(QSGAdaptationBackendData, qsg_adaptation_data) // This only works when the backend is loaded (contextFactory() was called), |