diff --git a/Sming/Core/Data/Stream/MemoryDataStream.h b/Sming/Core/Data/Stream/MemoryDataStream.h index cef511a62b..eeb9b67139 100644 --- a/Sming/Core/Data/Stream/MemoryDataStream.h +++ b/Sming/Core/Data/Stream/MemoryDataStream.h @@ -104,6 +104,17 @@ class MemoryDataStream : public ReadWriteStream readPos = 0; } + /** + * @brief Clear stream and release allocated memory + */ + void reset() + { + clear(); + free(buffer); + buffer = nullptr; + capacity = 0; + } + size_t getSize() const { return size;