[metal] Fix MetalWindowContext destruction on Mac

For Metal contexts, the method onDestroyContext() is only called when
we're deleting the context, so there's no need to set any values.
In the case where we're also tearing down the window, we especially
don't want to set anything in fMainView because the window's View has
already been deleted. This leads to an invalid access error, which is
particularly annoying when doing repeated debugger runs.

Change-Id: I5ee60a461980c3b47e2f198ae2070ae04c9ccc05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/634358
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2 files changed