From 45caa641e429136405194085e50305f7f23e98df Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 29 Nov 2016 12:26:32 +0100 Subject: Don't reference temporary memory --- common/commandprocessor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/commandprocessor.cpp') 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) if (Sink::Commands::VerifyFlushBuffer(verifier)) { auto buffer = Sink::Commands::GetFlush(data.constData()); const auto flushType = buffer->type(); - const auto flushId = BufferUtils::extractBuffer(buffer->id()); + const auto flushId = BufferUtils::extractBufferCopy(buffer->id()); if (flushType == Sink::Flush::FlushSynchronization) { mSynchronizer->flush(flushType, flushId); } else { @@ -323,7 +323,8 @@ KAsync::Job CommandProcessor::flush(void const *command, size_t size) if (Sink::Commands::VerifyFlushBuffer(verifier)) { auto buffer = Sink::Commands::GetFlush(command); const auto flushType = buffer->type(); - const auto flushId = BufferUtils::extractBuffer(buffer->id()); + const QByteArray flushId = BufferUtils::extractBufferCopy(buffer->id()); + Q_ASSERT(!flushId.isEmpty()); if (flushType == Sink::Flush::FlushReplayQueue) { SinkTrace() << "Flushing synchronizer "; Q_ASSERT(mSynchronizer); -- cgit v1.2.3