changeset 17891:706fb153f43d

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 c6db20805a87
children b330b424a882
files jdk/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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]];
 }