diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-05 15:23:05 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-06 11:38:05 +0000 |
commit | a88ca874970c57db275981a1a47a0bebb6b749a0 (patch) | |
tree | b0f8a9e0e40c25b2741df536bb4ba2a8240443a3 /src/qml/qml/qqmltypeloader.cpp | |
parent | 131243b3c8d71febe5294f0035844cea8a9e3049 (diff) |
Qml Tooling: Replace bare pointers with QScopedPointer
This way we don't have to manually initialize and delete them.
Change-Id: I0104c744dba380e957271d0924498e3643856e9e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 9b7b970e56..ce795be757 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -962,6 +962,14 @@ void QQmlTypeLoader::invalidate() #endif // qml_network } +#ifndef QT_NO_QML_DEBUGGER +void QQmlTypeLoader::setProfiler(QQmlProfiler *profiler) +{ + Q_ASSERT(!m_profiler); + m_profiler.reset(profiler); +} +#endif + void QQmlTypeLoader::lock() { m_thread->lock(); @@ -1596,9 +1604,6 @@ Constructs a new type loader that uses the given \a engine. */ QQmlTypeLoader::QQmlTypeLoader(QQmlEngine *engine) : m_engine(engine), m_thread(new QQmlTypeLoaderThread(this)), -#ifndef QT_NO_QML_DEBUGGER - m_profiler(nullptr), -#endif m_typeCacheTrimThreshold(TYPELOADER_MINIMUM_TRIM_THRESHOLD) { } @@ -1615,10 +1620,6 @@ QQmlTypeLoader::~QQmlTypeLoader() clearCache(); invalidate(); - -#ifndef QT_NO_QML_DEBUGGER - delete m_profiler; -#endif } QQmlImportDatabase *QQmlTypeLoader::importDatabase() const |