changeset 6117:75119057b941

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>
author anthony
date Mon, 03 Jun 2013 16:53:44 +0400
parents df33fcb65568
children b5393be7f815
files src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m	Fri May 31 16:30:05 2013 +0200
+++ b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m	Mon Jun 03 16:53:44 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]];
 }