diff --git a/Cocoa/Document.m b/Cocoa/Document.m index c7640dd1e..ab0037361 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -564,8 +564,7 @@ - (void)postRun { [_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 index 5a95f7d7e..c67a89096 100644 --- a/iOS/GBViewController.m +++ b/iOS/GBViewController.m @@ -891,10 +891,7 @@ - (UIImage *)imageFromData:(NSData *)data width:(unsigned)width height:(unsigned - (void)postRun { [_audioLock lock]; - if (_audioBuffer) { - memset(_audioBuffer, 0, (_audioBufferSize - _audioBufferPosition) * sizeof(*_audioBuffer)); - } - _audioBufferPosition = _audioBufferNeeded; + _audioBufferPosition = _audioBufferNeeded = 0; [_audioLock signal]; [_audioLock unlock]; [_audioClient stop];