From 9c8e4612403fc2accc26ac2b49670394972f1293 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 8 Dec 2016 17:43:07 +0100 Subject: One copy algorithm is enough. --- common/domain/applicationdomaintype.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/domain') diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index be14513..7c3800d 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -122,7 +122,7 @@ struct Reference { QByteArray value; }; -void copyBuffer(Sink::ApplicationDomain::BufferAdaptor &buffer, Sink::ApplicationDomain::BufferAdaptor &memoryAdaptor, const QList &properties, bool copyBlobs, bool pruneReferences); +void copyBuffer(Sink::ApplicationDomain::BufferAdaptor &buffer, Sink::ApplicationDomain::BufferAdaptor &memoryAdaptor, const QList &properties = QList(), bool copyBlobs = false, bool pruneReferences = false); /** * The domain type interface has two purposes: @@ -155,7 +155,8 @@ public: template static typename DomainType::Ptr getInMemoryRepresentation(const ApplicationDomainType &domainType, const QList properties = QList()) { - auto memoryAdaptor = QSharedPointer::create(*(domainType.mAdaptor), properties); + auto memoryAdaptor = QSharedPointer::create(); + copyBuffer(*(domainType.mAdaptor), *memoryAdaptor, properties, false, false); //mIdentifier internally still refers to the memory-mapped memory, we need to copy the memory or it will become invalid return QSharedPointer::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor); } -- cgit v1.2.3