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/pipeline.cpp | |
parent | 141f945b8d6828372e8919e954fa2d8991aa1a6f (diff) | |
download | sink-1803924a9474af03bf24bc00303c6373fdd05487.tar.gz sink-1803924a9474af03bf24bc00303c6373fdd05487.zip |
Fixed a bunch of memory leaks.
Found with valgrind
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r-- | common/pipeline.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index c6d5297..feceb77 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -79,6 +79,10 @@ Pipeline::Pipeline(const QString &resourceName, QObject *parent) : QObject(paren | |||
79 | 79 | ||
80 | Pipeline::~Pipeline() | 80 | Pipeline::~Pipeline() |
81 | { | 81 | { |
82 | d->transaction = Storage::Transaction(); | ||
83 | for (const auto &t : d->processors.keys()) { | ||
84 | qDeleteAll(d->processors.value(t)); | ||
85 | } | ||
82 | delete d; | 86 | delete d; |
83 | } | 87 | } |
84 | 88 | ||
@@ -108,9 +112,9 @@ void Pipeline::startTransaction() | |||
108 | Trace() << "Starting transaction."; | 112 | Trace() << "Starting transaction."; |
109 | d->transactionTime.start(); | 113 | d->transactionTime.start(); |
110 | d->transactionItemCount = 0; | 114 | d->transactionItemCount = 0; |
111 | d->transaction = std::move(storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { | 115 | d->transaction = storage().createTransaction(Storage::ReadWrite, [](const Sink::Storage::Error &error) { |
112 | Warning() << error.message; | 116 | Warning() << error.message; |
113 | })); | 117 | }); |
114 | 118 | ||
115 | //FIXME this is a temporary measure to recover from a failure to open the named databases correctly. | 119 | //FIXME this is a temporary measure to recover from a failure to open the named databases correctly. |
116 | //Once the actual problem is fixed it will be enough to simply crash if we open the wrong database (which we check in openDatabase already). | 120 | //Once the actual problem is fixed it will be enough to simply crash if we open the wrong database (which we check in openDatabase already). |