SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit b1fec625643618a452548801fbc5f9dbf0c2429f parent 2bf8feb299284aaef683eb9c395ca36ad9854aa8 Author: Lior Halphon <LIJI32@gmail.com> Date: Fri, 31 May 2024 20:41:00 +0300 Fix a potential crash upon pausing in iOS and macOS Diffstat:
| M | Cocoa/Document.m | 3 | +-- |
| M | iOS/GBViewController.m | 5 | +---- |
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/Cocoa/Document.m b/Cocoa/Document.m @@ -564,8 +564,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency) { [_hexTimer invalidate]; [_audioLock lock]; - memset(_audioBuffer, 0, (_audioBufferSize - _audioBufferPosition) * sizeof(*_audioBuffer)); - _audioBufferPosition = _audioBufferNeeded; + _audioBufferPosition = _audioBufferNeeded = 0; [_audioLock signal]; [_audioLock unlock]; [_audioClient stop]; diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m @@ -891,10 +891,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response - (void)postRun { [_audioLock lock]; - if (_audioBuffer) { - memset(_audioBuffer, 0, (_audioBufferSize - _audioBufferPosition) * sizeof(*_audioBuffer)); - } - _audioBufferPosition = _audioBufferNeeded; + _audioBufferPosition = _audioBufferNeeded = 0; [_audioLock signal]; [_audioLock unlock]; [_audioClient stop];
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.