From 355ce6497ea5b42b77d3f65e6592be804dfa9a57 Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 30 May 2013 18:10:26 +0400 Subject: [PATCH] 8015303: [macosx] Application launched via custom URL Scheme does not receive URL Summary: Make copies of event parameters Reviewed-by: anthony, swingler, serb Contributed-by: James Tomson --- src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m index 5b71d8ab9..736155fdc 100644 --- a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m +++ b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m @@ -110,8 +110,14 @@ - (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEvent:(NSAppleEventDescriptor *)replyEvent { + // Make an explicit copy of the passed events as they may be invalidated by the time they're processed + NSAppleEventDescriptor *openURLEventCopy = [openURLEvent copy]; + NSAppleEventDescriptor *replyEventCopy = [replyEvent copy]; + [self.queue addObject:[^(){ - [self.realDelegate _handleOpenURLEvent:openURLEvent withReplyEvent:replyEvent]; + [self.realDelegate _handleOpenURLEvent:openURLEventCopy withReplyEvent:replyEventCopy]; + [openURLEventCopy release]; + [replyEventCopy release]; } copy]]; } -- GitLab