diff --git a/src/bindings/wasm/tvgWasm.cpp b/src/bindings/wasm/tvgWasm.cpp index f390a2c4..f4498b3e 100644 --- a/src/bindings/wasm/tvgWasm.cpp +++ b/src/bindings/wasm/tvgWasm.cpp @@ -159,6 +159,7 @@ public: this->width = width; this->height = height; + free(buffer); buffer = (uint8_t*)malloc(width * height * sizeof(uint32_t)); canvas->target((uint32_t *)buffer, width, width, height, SwCanvas::ABGR8888S);