From ed9fc22ea607df7565900ea8a565695edbae1e97 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 23 Mar 2021 16:35:22 +0900 Subject: [PATCH] common paint: fix memory leak case. free the previous composition target if any, before reset with the new one. --- src/lib/tvgPaint.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/tvgPaint.h b/src/lib/tvgPaint.h index e3846e9..464de43 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; -- 2.7.4