mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13:43 +00:00
svg_loader: release resources just in case when it's destroyed.
Change-Id: Ib4a61ae0769d3f9284e3cf450002750c47fba01c
This commit is contained in:
parent
be6e39eb02
commit
a94bd31d56
1 changed files with 7 additions and 2 deletions
|
@ -2242,7 +2242,7 @@ SvgLoader::SvgLoader() :
|
||||||
|
|
||||||
SvgLoader::~SvgLoader()
|
SvgLoader::~SvgLoader()
|
||||||
{
|
{
|
||||||
if (rootProgress.valid()) root = rootProgress.get();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2305,8 +2305,13 @@ bool SvgLoader::close()
|
||||||
{
|
{
|
||||||
if (rootProgress.valid()) root = rootProgress.get();
|
if (rootProgress.valid()) root = rootProgress.get();
|
||||||
|
|
||||||
if (loaderData.svgParse) free(loaderData.svgParse);
|
if (loaderData.svgParse) {
|
||||||
|
free(loaderData.svgParse);
|
||||||
|
loaderData.svgParse = nullptr;
|
||||||
|
}
|
||||||
_freeSvgNode(loaderData.doc);
|
_freeSvgNode(loaderData.doc);
|
||||||
|
loaderData.doc = nullptr;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue