Skip to content

Native SKPaint leak in TextBlock.Paint (PaintSelectionHandle) #109

@Beldaa

Description

@Beldaa

In TextBlock.Paint(), PaintSelectionBackground is explicitly disposed after use, but PaintSelectionHandle is not.

Since PaintSelectionHandle is created inside the Paint method (when selection handles are enabled), it should be disposed to avoid leaking native memory on every paint call.

// TextBlock.cs
if (ShowSelectionHandles)
{
    using (var paint = PaintSelectionHandle)
    {
        // ... use paint ...
    }
}

Currently, it's just var paint = PaintSelectionHandle; without disposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions