mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-01 04:51:58 +02:00
Fixed a crash in the Cocoa port that might happen after closing GameBoy Camera
This commit is contained in:
@@ -266,6 +266,7 @@ static void printImage(GB_gameboy_t *gb, uint32_t *image, uint8_t height,
|
|||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
|
[cameraSession stopRunning];
|
||||||
GB_free(&gb);
|
GB_free(&gb);
|
||||||
if (cameraImage) {
|
if (cameraImage) {
|
||||||
CVBufferRelease(cameraImage);
|
CVBufferRelease(cameraImage);
|
||||||
@@ -866,7 +867,6 @@ static void printImage(GB_gameboy_t *gb, uint32_t *image, uint8_t height,
|
|||||||
|
|
||||||
[cameraSession addInput: input];
|
[cameraSession addInput: input];
|
||||||
[cameraSession addOutput: cameraOutput];
|
[cameraSession addOutput: cameraOutput];
|
||||||
/* ARC will stop the session when the window is closed. */
|
|
||||||
[cameraSession startRunning];
|
[cameraSession startRunning];
|
||||||
cameraConnection = [cameraOutput connectionWithMediaType: AVMediaTypeVideo];
|
cameraConnection = [cameraOutput connectionWithMediaType: AVMediaTypeVideo];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user