changeset 11164:f7fad52517da

Merge
author asaha
date Wed, 05 Aug 2015 16:12:40 -0700
parents 3417c15c749b c4acff2d23dd
children cf0cf52d0c6c
files .hgtags
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Aug 03 11:46:21 2015 -0700
+++ b/.hgtags	Wed Aug 05 16:12:40 2015 -0700
@@ -456,6 +456,7 @@
 d433f5fd8910bee1f2c295b65cf03977034fe0ea jdk8u60-b24
 c8cfbe57bcd5042d2fef42dcef14d73dd4bdc416 jdk8u60-b25
 0d6a8a9b26a37678b420ff540b5a622c3f4fd44c jdk8u60-b26
+afbc08ea922bf6e5e14d2eea24a2f94f37627ea7 jdk8u60-b27
 286b9a885fcc6245fdf2b20697473ec3b35f2538 jdk8u65-b00
 80a796d0db958f49a4b0713818227eda8e5efbb9 jdk8u65-b01
 77d48e6d111faec236c8678997ae4311151cfee4 jdk8u65-b02
--- a/src/macosx/native/sun/awt/CFRetainedResource.m	Mon Aug 03 11:46:21 2015 -0700
+++ b/src/macosx/native/sun/awt/CFRetainedResource.m	Wed Aug 05 16:12:40 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);