Fix MetalWindowContext::swapBuffers.

It looks like we were expecting the drawable to be retained outside
of swapBuffers(), which isn't always the case. Move the release
to the end of the method to retain locally until we're done with it.

Bug: skia:10597
Change-Id: Ieff6a3add0554b5b221700aff88fefd7c8502f41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309724
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
1 file changed