From 1803924a9474af03bf24bc00303c6373fdd05487 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 6 Jul 2016 17:52:33 +0200 Subject: Fixed a bunch of memory leaks. Found with valgrind --- common/storage.h | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'common/storage.h') diff --git a/common/storage.h b/common/storage.h index e7b4a3e..4ef20d5 100644 --- a/common/storage.h +++ b/common/storage.h @@ -103,18 +103,8 @@ public: */ bool contains(const QByteArray &uid); - NamedDatabase(NamedDatabase &&other) : d(other.d) - { - d = other.d; - other.d = nullptr; - } - - NamedDatabase &operator=(NamedDatabase &&other) - { - d = other.d; - other.d = nullptr; - return *this; - } + NamedDatabase(NamedDatabase &&other); + NamedDatabase &operator=(NamedDatabase &&other); operator bool() const { @@ -146,17 +136,8 @@ public: NamedDatabase openDatabase(const QByteArray &name = QByteArray("default"), const std::function &errorHandler = std::function(), bool allowDuplicates = false) const; - Transaction(Transaction &&other) : d(other.d) - { - d = other.d; - other.d = nullptr; - } - Transaction &operator=(Transaction &&other) - { - d = other.d; - other.d = nullptr; - return *this; - } + Transaction(Transaction &&other); + Transaction &operator=(Transaction &&other); operator bool() const; -- cgit v1.2.3