summaryrefslogtreecommitdiffstats
path: root/common/commandprocessor.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/commandprocessor.cpp
parent6a072b2dcf23cbcdb210f2bd5c273ea0f425b188 (diff)
downloadsink-45caa641e429136405194085e50305f7f23e98df.tar.gz
sink-45caa641e429136405194085e50305f7f23e98df.zip
Don't reference temporary memory
Diffstat (limited to 'common/commandprocessor.cpp')
-rw-r--r--common/commandprocessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/commandprocessor.cpp b/common/commandprocessor.cpp
index 8eb0ef1..06ee142 100644
--- a/common/commandprocessor.cpp
+++ b/common/commandprocessor.cpp
@@ -103,7 +103,7 @@ void CommandProcessor::processFlushCommand(const QByteArray &data)
103 if (Sink::Commands::VerifyFlushBuffer(verifier)) { 103 if (Sink::Commands::VerifyFlushBuffer(verifier)) {
104 auto buffer = Sink::Commands::GetFlush(data.constData()); 104 auto buffer = Sink::Commands::GetFlush(data.constData());
105 const auto flushType = buffer->type(); 105 const auto flushType = buffer->type();
106 const auto flushId = BufferUtils::extractBuffer(buffer->id()); 106 const auto flushId = BufferUtils::extractBufferCopy(buffer->id());
107 if (flushType == Sink::Flush::FlushSynchronization) { 107 if (flushType == Sink::Flush::FlushSynchronization) {
108 mSynchronizer->flush(flushType, flushId); 108 mSynchronizer->flush(flushType, flushId);
109 } else { 109 } else {
@@ -323,7 +323,8 @@ KAsync::Job<void> CommandProcessor::flush(void const *command, size_t size)
323 if (Sink::Commands::VerifyFlushBuffer(verifier)) { 323 if (Sink::Commands::VerifyFlushBuffer(verifier)) {
324 auto buffer = Sink::Commands::GetFlush(command); 324 auto buffer = Sink::Commands::GetFlush(command);
325 const auto flushType = buffer->type(); 325 const auto flushType = buffer->type();
326 const auto flushId = BufferUtils::extractBuffer(buffer->id()); 326 const QByteArray flushId = BufferUtils::extractBufferCopy(buffer->id());
327 Q_ASSERT(!flushId.isEmpty());
327 if (flushType == Sink::Flush::FlushReplayQueue) { 328 if (flushType == Sink::Flush::FlushReplayQueue) {
328 SinkTrace() << "Flushing synchronizer "; 329 SinkTrace() << "Flushing synchronizer ";
329 Q_ASSERT(mSynchronizer); 330 Q_ASSERT(mSynchronizer);