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 <james.b.tomson@gmail.com>
--- a/jdk/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m Wed May 29 18:40:02 2013 +0400
+++ b/jdk/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m Thu May 30 18:10:26 2013 +0400
@@ -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]];
}