8015303: [macosx] Application launched via custom URL Scheme does not receive URL

Make copies of event parameters

Reviewed-by: anthony, swingler, serb
This commit is contained in:
James Tomson 2013-05-30 18:10:26 +04:00 committed by Anthony Petrov
parent d463443af2
commit 36b5e14b31

View File

@ -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]];
}