diff options
-rw-r--r-- | Source/SPGrowlController.m | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m index 91690546..a92dbdda 100644 --- a/Source/SPGrowlController.m +++ b/Source/SPGrowlController.m @@ -25,6 +25,7 @@ #import "SPGrowlController.h" #import "SPConstants.h" +#import "SPMainThreadTrampoline.h" #include <mach/mach_time.h> @@ -88,6 +89,13 @@ static SPGrowlController *sharedGrowlController = nil; */ - (void)notifyWithTitle:(NSString *)title description:(NSString *)description window:(NSWindow *)window notificationName:(NSString *)name { + + // Ensure that the delayed notification call is made on the main thread + if (![NSThread isMainThread]) { + [[self onMainThread] notifyWithTitle:title description:description window:window notificationName:name]; + return; + } + NSMutableDictionary *notificationDictionary = [NSMutableDictionary dictionary]; [notificationDictionary setObject:title forKey:@"title"]; [notificationDictionary setObject:description forKey:@"description"]; |