summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimedatabase_p.h
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2018-06-29 16:31:31 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2018-10-22 16:24:40 +0000
commit17f4adfe1840f507ada69fa6f25238c4c72064c3 (patch)
tree37e2cf2732b06518013a7dddd2054fc258b5a4b5 /src/corelib/mimetypes/qmimedatabase_p.h
parent6c543879a31d7d13a6b87e6332f6913f2f89f5e6 (diff)
Use std::unique_ptr for memory management in QMimeDataBasePrivate
This change simplifies memory management as long as it doesn't requires manuall calls to qDeleteAll and manual deleting/nulling pointers. Change-Id: Id0dc563d0b1e74ae33939d90d4b39999020cd7ce Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimedatabase_p.h')
-rw-r--r--src/corelib/mimetypes/qmimedatabase_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h
index 4260718af6..05267d83c5 100644
--- a/src/corelib/mimetypes/qmimedatabase_p.h
+++ b/src/corelib/mimetypes/qmimedatabase_p.h
@@ -63,6 +63,8 @@
#include <QtCore/qmutex.h>
#include <QtCore/qvector.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QIODevice;
@@ -102,7 +104,7 @@ public:
bool mimeInherits(const QString &mime, const QString &parent);
private:
- using Providers = std::vector<QMimeProviderBase *>;
+ using Providers = std::vector<std::unique_ptr<QMimeProviderBase>>;
const Providers &providers();
bool shouldCheck();
void loadProviders();