Skip to content

ChromiumWebBrowser can throw NullReferenceException after Dispose() #1004

@jamespearce2006

Description

@jamespearce2006

If the UI thread is blocked for a portion of time before calling Dispose(), it's possible that race condition occurs with InvokeRenderAsync

The upshot is that InvokeRenderAsync does its invoke after Dispose has already finished. In this case, the FileMappingHandle in InteropBitmapInfo will be set to IntPtr.Zero, and things go bad.

I've fixed this by specifically checking for a null Bitmap, and an empty FileMappingHandle, which fixes the problem for me.

Pull Request #1003

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions