diff --git a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m index 5b71d8ab96c91ff1a20bf33bbf4e94115b75f423..736155fdc0121055233965cd3d116355404c40e0 100644 --- a/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m +++ b/src/macosx/native/sun/osxapp/QueuingApplicationDelegate.m @@ -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]]; }