changeset 7248:768fcc36182a

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 Thu, 30 May 2013 18:10:26 +0400
parents c8a0abc1fd2d
children 8472c148688c
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	Wed May 29 18:40:02 2013 +0400
+++ b/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]];
 }