summaryrefslogtreecommitdiffstats
path: root/common/synchronizer.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-11-29 12:26:32 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-11-29 12:26:32 +0100
commit45caa641e429136405194085e50305f7f23e98df (patch)
treebfdcacbcb4f3d834a7713b047c578a532d7fbe3f /common/synchronizer.cpp
parent6a072b2dcf23cbcdb210f2bd5c273ea0f425b188 (diff)
downloadsink-45caa641e429136405194085e50305f7f23e98df.tar.gz
sink-45caa641e429136405194085e50305f7f23e98df.zip
Don't reference temporary memory
Diffstat (limited to 'common/synchronizer.cpp')
-rw-r--r--common/synchronizer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp
index 6483cdf..036288e 100644
--- a/common/synchronizer.cpp
+++ b/common/synchronizer.cpp
@@ -268,7 +268,8 @@ void Synchronizer::synchronize(const Sink::QueryBase &query)
268 268
269void Synchronizer::flush(int commandId, const QByteArray &flushId) 269void Synchronizer::flush(int commandId, const QByteArray &flushId)
270{ 270{
271 SinkTrace() << "Flushing the synchronization queue"; 271 Q_ASSERT(!flushId.isEmpty());
272 SinkTrace() << "Flushing the synchronization queue " << flushId;
272 mSyncRequestQueue << Synchronizer::SyncRequest{Synchronizer::SyncRequest::Flush, commandId, flushId}; 273 mSyncRequestQueue << Synchronizer::SyncRequest{Synchronizer::SyncRequest::Flush, commandId, flushId};
273 processSyncQueue().exec(); 274 processSyncQueue().exec();
274} 275}
@@ -318,6 +319,7 @@ KAsync::Job<void> Synchronizer::processSyncQueue()
318 } 319 }
319 }); 320 });
320 } else if (request.requestType == Synchronizer::SyncRequest::Flush) { 321 } else if (request.requestType == Synchronizer::SyncRequest::Flush) {
322 Q_ASSERT(!request.requestId.isEmpty());
321 if (request.flushType == Flush::FlushReplayQueue) { 323 if (request.flushType == Flush::FlushReplayQueue) {
322 SinkTrace() << "Emitting flush completion."; 324 SinkTrace() << "Emitting flush completion.";
323 Sink::Notification n; 325 Sink::Notification n;
@@ -326,7 +328,7 @@ KAsync::Job<void> Synchronizer::processSyncQueue()
326 emit notify(n); 328 emit notify(n);
327 } else { 329 } else {
328 flatbuffers::FlatBufferBuilder fbb; 330 flatbuffers::FlatBufferBuilder fbb;
329 auto flushId = fbb.CreateString(request.requestId); 331 auto flushId = fbb.CreateString(request.requestId.toStdString());
330 auto location = Sink::Commands::CreateFlush(fbb, flushId, static_cast<int>(Sink::Flush::FlushSynchronization)); 332 auto location = Sink::Commands::CreateFlush(fbb, flushId, static_cast<int>(Sink::Flush::FlushSynchronization));
331 Sink::Commands::FinishFlushBuffer(fbb, location); 333 Sink::Commands::FinishFlushBuffer(fbb, location);
332 enqueueCommand(Sink::Commands::FlushCommand, BufferUtils::extractBuffer(fbb)); 334 enqueueCommand(Sink::Commands::FlushCommand, BufferUtils::extractBuffer(fbb));