Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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