changeset 11163:c4acff2d23dd

Merge
author asaha
date Wed, 05 Aug 2015 16:04:04 -0700
parents 3b1d74b22fae 48e79820c798
children f7fad52517da
files .hgtags
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jul 29 14:21:41 2015 -0700
+++ b/.hgtags	Wed Aug 05 16:04:04 2015 -0700
@@ -456,3 +456,4 @@
 d433f5fd8910bee1f2c295b65cf03977034fe0ea jdk8u60-b24
 c8cfbe57bcd5042d2fef42dcef14d73dd4bdc416 jdk8u60-b25
 0d6a8a9b26a37678b420ff540b5a622c3f4fd44c jdk8u60-b26
+afbc08ea922bf6e5e14d2eea24a2f94f37627ea7 jdk8u60-b27
--- a/src/macosx/native/sun/awt/CFRetainedResource.m	Wed Jul 29 14:21:41 2015 -0700
+++ b/src/macosx/native/sun/awt/CFRetainedResource.m	Wed Aug 05 16:04:04 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,10 +40,17 @@
     if (releaseOnAppKitThread) {
         // Releasing resources on the main AppKit message loop only
         // Releasing resources on the nested loops may cause dangling 
-        // pointers after the nested loop is exited 
-        [NSApp postRunnableEvent:^(){
-            CFRelease(jlong_to_ptr(ptr));
-        }];
+        // pointers after the nested loop is exited
+        if ([NSApp respondsToSelector:@selector(postRunnableEvent:)]) {
+            [NSApp postRunnableEvent:^() {
+                CFRelease(jlong_to_ptr(ptr));
+            }];
+        } else {
+            // could happen if we are embedded inside SWT/FX application,
+            [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
+                CFRelease(jlong_to_ptr(ptr));
+            }];
+        }
     } else {
 
 JNF_COCOA_ENTER(env);