fixes possible reace condition bug still resulting in multiple warnings

This commit is contained in:
michael starke
2016-11-17 11:16:56 +01:00
parent 745f283742
commit 69a06224cb

View File

@@ -279,12 +279,12 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou
if(self.fileChangeDialogOpen) {
return; // We are already displaying an alert
}
/* Set the flag in this call! */
self.fileChangeDialogOpen = YES;
/* Dispatch the alert to the main queue */
dispatch_async(dispatch_get_main_queue(), ^{
self.fileChangeDialogOpen = YES;
NSAlert *alert = [[NSAlert alloc] init];
alert.alertStyle = NSWarningAlertStyle;
alert.messageText = NSLocalizedString(@"FILE_CHANGED_BY_OTHERS_MESSAGE_TEXT", @"Message displayed when an open file was changed from another application");