mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 22:23:27 +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)
|
||||
{
|
||||
if ((!target && method != CompositeMethod::None) || (target && method == CompositeMethod::None)) return false;
|
||||
if (cmpTarget) delete(cmpTarget);
|
||||
cmpTarget = target;
|
||||
cmpMethod = method;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue