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/synchronizer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common/synchronizer.cpp') 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) void Synchronizer::flush(int commandId, const QByteArray &flushId) { - SinkTrace() << "Flushing the synchronization queue"; + Q_ASSERT(!flushId.isEmpty()); + SinkTrace() << "Flushing the synchronization queue " << flushId; mSyncRequestQueue << Synchronizer::SyncRequest{Synchronizer::SyncRequest::Flush, commandId, flushId}; processSyncQueue().exec(); } @@ -318,6 +319,7 @@ KAsync::Job Synchronizer::processSyncQueue() } }); } else if (request.requestType == Synchronizer::SyncRequest::Flush) { + Q_ASSERT(!request.requestId.isEmpty()); if (request.flushType == Flush::FlushReplayQueue) { SinkTrace() << "Emitting flush completion."; Sink::Notification n; @@ -326,7 +328,7 @@ KAsync::Job Synchronizer::processSyncQueue() emit notify(n); } else { flatbuffers::FlatBufferBuilder fbb; - auto flushId = fbb.CreateString(request.requestId); + auto flushId = fbb.CreateString(request.requestId.toStdString()); auto location = Sink::Commands::CreateFlush(fbb, flushId, static_cast(Sink::Flush::FlushSynchronization)); Sink::Commands::FinishFlushBuffer(fbb, location); enqueueCommand(Sink::Commands::FlushCommand, BufferUtils::extractBuffer(fbb)); -- cgit v1.2.3