mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
Heap fragmentation optimization
Moving object creation to task constructors
This commit is contained in:
@@ -71,6 +71,9 @@ public:
|
||||
}
|
||||
|
||||
bool result = this->writer->publish(topic, doc, true);
|
||||
doc.clear();
|
||||
doc.shrinkToFit();
|
||||
|
||||
if (this->eventPublishCallback) {
|
||||
this->eventPublishCallback(topic, result);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ public:
|
||||
size_t written = 0;
|
||||
if (this->client->beginPublish(topic, docSize, retained)) {
|
||||
serializeJson(doc, *this);
|
||||
doc.clear();
|
||||
this->flush();
|
||||
|
||||
written = this->writeAfterLock;
|
||||
|
||||
Reference in New Issue
Block a user