From aa68481fb704fe41ef8fff3413be22fa2e5a4bc5 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 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;