Fixed a crash that happened when changing the rewind length in Cocoa

This commit is contained in:
Lior Halphon 2018-06-23 11:50:08 +03:00
parent 1915365b1a
commit 74abf61a08
1 changed files with 5 additions and 3 deletions

View File

@ -1411,9 +1411,11 @@ static void printImage(GB_gameboy_t *gb, uint32_t *image, uint8_t height,
- (void) updateRewindLength
{
if (GB_is_inited(&gb)) {
GB_set_rewind_length(&gb, [[NSUserDefaults standardUserDefaults] integerForKey:@"GBRewindLength"]);
}
[self performAtomicBlock:^{
if (GB_is_inited(&gb)) {
GB_set_rewind_length(&gb, [[NSUserDefaults standardUserDefaults] integerForKey:@"GBRewindLength"]);
}
}];
}
@end