Skip to content

Commit

Permalink
Fix SKCanvasView dispose exception when the view is disposed before i…
Browse files Browse the repository at this point in the history
…t's rendered (#2472)
  • Loading branch information
jjzhang12 authored Jun 12, 2023
1 parent a426c16 commit 397253d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ private void OnSizeChanged(SKSize newSize)

public void Dispose()
{
dpiWatcher.Unsubscribe(OnDpiChanged);
sizeWatcher.Dispose();
interop.Dispose();
dpiWatcher?.Unsubscribe(OnDpiChanged);
sizeWatcher?.Dispose();
interop?.Dispose();

FreeBitmap();
}
Expand Down

0 comments on commit 397253d

Please sign in to comment.