diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 670e179f81..20ca5c94d4 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -2524,10 +2524,11 @@ bool DomainServer::processPendingContent(HTTPConnection* connection, QString ite const auto peerAddressHash = qHash(connection->socket()->peerAddress()); if (_pendingContentFiles.find(peerAddressHash) == _pendingContentFiles.end()) { - _pendingContentFiles.emplace(peerAddressHash, TEMPORARY_CONTENT_FILEPATH); + std::unique_ptr newTemp(new QTemporaryFile(TEMPORARY_CONTENT_FILEPATH)); + _pendingContentFiles[peerAddressHash] = std::move(newTemp); } - QTemporaryFile& _pendingFileContent = _pendingContentFiles[peerAddressHash]; + QTemporaryFile& _pendingFileContent = *_pendingContentFiles[peerAddressHash]; if (!_pendingFileContent.open()) { _pendingContentFiles.erase(peerAddressHash); connection->respond(HTTPConnection::StatusCode400); diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 2d5729be59..5d6cd4e5f9 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -285,7 +285,7 @@ private: QHash> _pendingOAuthConnections; std::unordered_map _pendingUploadedContents; - std::unordered_map _pendingContentFiles; + std::unordered_map> _pendingContentFiles; QThread _assetClientThread; };