From 517e402a97b8af60b8ef0518337a33344ecba504 Mon Sep 17 00:00:00 2001 From: Beldaa Date: Sat, 18 Apr 2026 16:42:14 +0200 Subject: [PATCH] Fix SKPaint leak: dispose PaintSelectionHandle in TextBlock.Paint PaintSelectionBackground was disposed after painting but PaintSelectionHandle was not, leaking native memory on every Paint call when selection handles are enabled. --- Topten.RichTextKit/TextBlock.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Topten.RichTextKit/TextBlock.cs b/Topten.RichTextKit/TextBlock.cs index f6f6001..186925e 100644 --- a/Topten.RichTextKit/TextBlock.cs +++ b/Topten.RichTextKit/TextBlock.cs @@ -1,4 +1,4 @@ - + // RichTextKit // Copyright © 2019-2020 Topten Software. All Rights Reserved. // @@ -447,6 +447,7 @@ public void Paint(SKCanvas canvas, TextPaintOptions options = null) // Clean up ctx.PaintSelectionBackground?.Dispose(); + ctx.PaintSelectionHandle?.Dispose(); } ///