diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-06 17:52:33 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-06 17:52:33 +0200 |
commit | 1803924a9474af03bf24bc00303c6373fdd05487 (patch) | |
tree | 25c77a9c4c8831d93ffe687d49a3aefaa5a184ca /common/storage.h | |
parent | 141f945b8d6828372e8919e954fa2d8991aa1a6f (diff) | |
download | sink-1803924a9474af03bf24bc00303c6373fdd05487.tar.gz sink-1803924a9474af03bf24bc00303c6373fdd05487.zip |
Fixed a bunch of memory leaks.
Found with valgrind
Diffstat (limited to 'common/storage.h')
-rw-r--r-- | common/storage.h | 27 |
1 files changed, 4 insertions, 23 deletions
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: | |||
103 | */ | 103 | */ |
104 | bool contains(const QByteArray &uid); | 104 | bool contains(const QByteArray &uid); |
105 | 105 | ||
106 | NamedDatabase(NamedDatabase &&other) : d(other.d) | 106 | NamedDatabase(NamedDatabase &&other); |
107 | { | 107 | NamedDatabase &operator=(NamedDatabase &&other); |
108 | d = other.d; | ||
109 | other.d = nullptr; | ||
110 | } | ||
111 | |||
112 | NamedDatabase &operator=(NamedDatabase &&other) | ||
113 | { | ||
114 | d = other.d; | ||
115 | other.d = nullptr; | ||
116 | return *this; | ||
117 | } | ||
118 | 108 | ||
119 | operator bool() const | 109 | operator bool() const |
120 | { | 110 | { |
@@ -146,17 +136,8 @@ public: | |||
146 | NamedDatabase openDatabase(const QByteArray &name = QByteArray("default"), | 136 | NamedDatabase openDatabase(const QByteArray &name = QByteArray("default"), |
147 | const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>(), bool allowDuplicates = false) const; | 137 | const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>(), bool allowDuplicates = false) const; |
148 | 138 | ||
149 | Transaction(Transaction &&other) : d(other.d) | 139 | Transaction(Transaction &&other); |
150 | { | 140 | Transaction &operator=(Transaction &&other); |
151 | d = other.d; | ||
152 | other.d = nullptr; | ||
153 | } | ||
154 | Transaction &operator=(Transaction &&other) | ||
155 | { | ||
156 | d = other.d; | ||
157 | other.d = nullptr; | ||
158 | return *this; | ||
159 | } | ||
160 | 141 | ||
161 | operator bool() const; | 142 | operator bool() const; |
162 | 143 | ||