mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
SvgLoader: Fix memory leak for loader's gradient
Release the memory that was not released.
This commit is contained in:
parent
c27a952f44
commit
497c1ef131
1 changed files with 7 additions and 0 deletions
|
@ -2377,6 +2377,13 @@ bool SvgLoader::close()
|
|||
free(loaderData.svgParse);
|
||||
loaderData.svgParse = nullptr;
|
||||
}
|
||||
auto gradients = loaderData.gradients.list;
|
||||
for (size_t i = 0; i < loaderData.gradients.cnt; ++i) {
|
||||
_freeGradientStyle(*gradients);
|
||||
++gradients;
|
||||
}
|
||||
loaderData.gradients.clear();
|
||||
|
||||
_freeNode(loaderData.doc);
|
||||
loaderData.doc = nullptr;
|
||||
loaderData.stack.clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue