mirror of https://github.com/bsnes-emu/bsnes.git
Fixed a potential Cocoa crash when closing a window
This commit is contained in:
parent
9651f2bb6b
commit
f0809a667f
|
@ -389,6 +389,7 @@ static void audioCallback(GB_gameboy_t *gb, GB_sample_t *sample)
|
|||
- (void)dealloc
|
||||
{
|
||||
[cameraSession stopRunning];
|
||||
self.view.gb = NULL;
|
||||
GB_free(&gb);
|
||||
if (cameraImage) {
|
||||
CVBufferRelease(cameraImage);
|
||||
|
|
|
@ -131,6 +131,7 @@ static const vector_float2 rect[] =
|
|||
- (void)drawInMTKView:(nonnull MTKView *)view
|
||||
{
|
||||
if (!(view.window.occlusionState & NSWindowOcclusionStateVisible)) return;
|
||||
if (!self.gb) return;
|
||||
if (texture.width != GB_get_screen_width(self.gb) ||
|
||||
texture.height != GB_get_screen_height(self.gb)) {
|
||||
[self allocateTextures];
|
||||
|
|
Loading…
Reference in New Issue