diff --git a/src/lib/tvgPaint.h b/src/lib/tvgPaint.h index e3846e9d..464de437 100644 --- a/src/lib/tvgPaint.h +++ b/src/lib/tvgPaint.h @@ -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;