mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-10 22:51:58 +00:00
common paint: fix memory leak case.
free the previous composition target if any, before reset with the new one.
This commit is contained in:
parent
1a7d41ce71
commit
aa68481fb7
1 changed files with 1 additions and 0 deletions
|
@ -224,6 +224,7 @@ namespace tvg
|
||||||
bool composite(Paint* target, CompositeMethod method)
|
bool composite(Paint* target, CompositeMethod method)
|
||||||
{
|
{
|
||||||
if ((!target && method != CompositeMethod::None) || (target && method == CompositeMethod::None)) return false;
|
if ((!target && method != CompositeMethod::None) || (target && method == CompositeMethod::None)) return false;
|
||||||
|
if (cmpTarget) delete(cmpTarget);
|
||||||
cmpTarget = target;
|
cmpTarget = target;
|
||||||
cmpMethod = method;
|
cmpMethod = method;
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue