mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 14:48:24 +00:00
binding wasm: fix a memory leak.
clear the buffer memory properly when a canvas size is changed.
This commit is contained in:
parent
da1b036e4f
commit
c97c60b900
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue