Skip to content

Commit a158903

Browse files
Fixed accessing AppKit element from background thread.
When forking a new code snippet repo (Plug-ins -> Configure snippets repo) when checking the console logs AppKit outputs the following entry: NSAlert is being used from a background thread, which is not safe. This is probably going to crash sometimes. Break on void _NSAlertWarnUnsafeBackgroundThreadUsage() to debug. This will be logged only once. This may break in the future.
1 parent b058104 commit a158903

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ACCodeSnippetRepository/Controllers/ACCodeSnippetRepositoryConfigurationWindowController.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ - (IBAction)forkRemoteRepositoryAction:(id)sender {
120120
[weakSelf.window endSheet:weakSelf.progressPanel];
121121
[weakSelf.progressIndicator stopAnimation:weakSelf];
122122
});
123-
124-
[weakSelf importUserSnippetsAction:weakSelf];
123+
124+
dispatch_async(dispatch_get_main_queue(), ^{
125+
[weakSelf importUserSnippetsAction:weakSelf];
126+
});
125127
});
126128

127129
break;

0 commit comments

Comments
 (0)