diff options
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r-- | common/genericresource.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 2b9e7b2..ed7dd46 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -240,7 +240,7 @@ GenericResource::GenericResource(const QByteArray &resourceType, const QByteArra | |||
240 | mClientLowerBoundRevision(std::numeric_limits<qint64>::max()) | 240 | mClientLowerBoundRevision(std::numeric_limits<qint64>::max()) |
241 | { | 241 | { |
242 | mPipeline->setResourceType(mResourceType); | 242 | mPipeline->setResourceType(mResourceType); |
243 | mProcessor = new CommandProcessor(mPipeline.data(), QList<MessageQueue *>() << &mUserQueue << &mSynchronizerQueue); | 243 | mProcessor = std::unique_ptr<CommandProcessor>(new CommandProcessor(mPipeline.data(), QList<MessageQueue *>() << &mUserQueue << &mSynchronizerQueue)); |
244 | mProcessor->setInspectionCommand([this](void const *command, size_t size) { | 244 | mProcessor->setInspectionCommand([this](void const *command, size_t size) { |
245 | flatbuffers::Verifier verifier((const uint8_t *)command, size); | 245 | flatbuffers::Verifier verifier((const uint8_t *)command, size); |
246 | if (Sink::Commands::VerifyInspectionBuffer(verifier)) { | 246 | if (Sink::Commands::VerifyInspectionBuffer(verifier)) { |
@@ -280,7 +280,7 @@ GenericResource::GenericResource(const QByteArray &resourceType, const QByteArra | |||
280 | return KAsync::error<void>(-1, "Invalid inspection command."); | 280 | return KAsync::error<void>(-1, "Invalid inspection command."); |
281 | }); | 281 | }); |
282 | { | 282 | { |
283 | auto ret =QObject::connect(mProcessor, &CommandProcessor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); | 283 | auto ret =QObject::connect(mProcessor.get(), &CommandProcessor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); |
284 | Q_ASSERT(ret); | 284 | Q_ASSERT(ret); |
285 | } | 285 | } |
286 | { | 286 | { |
@@ -296,7 +296,6 @@ GenericResource::GenericResource(const QByteArray &resourceType, const QByteArra | |||
296 | 296 | ||
297 | GenericResource::~GenericResource() | 297 | GenericResource::~GenericResource() |
298 | { | 298 | { |
299 | delete mProcessor; | ||
300 | } | 299 | } |
301 | 300 | ||
302 | KAsync::Job<void> GenericResource::inspect( | 301 | KAsync::Job<void> GenericResource::inspect( |