mirror of https://github.com/LIJI32/SameBoy.git
Fix a potential crash upon pausing in iOS and macOS
This commit is contained in:
parent
2bf8feb299
commit
b1fec62564
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue