--- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2016-10-19 16:30:13.000000000 -0700 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java 2016-10-19 16:30:13.000000000 -0700 @@ -178,12 +178,6 @@ return; } - // See if this has an NSPrintInfo in it. - NSPrintInfo nsPrintInfo = (NSPrintInfo)attributes.get(NSPrintInfo.class); - if (nsPrintInfo != null) { - fNSPrintInfo = nsPrintInfo.getValue(); - } - PageRanges pageRangesAttr = (PageRanges)attributes.get(PageRanges.class); if (isSupportedValue(pageRangesAttr, attributes)) { SunPageSelection rangeSelect = (SunPageSelection)attributes.get(SunPageSelection.class); @@ -563,8 +557,11 @@ @Override protected void finalize() { - if (fNSPrintInfo != -1) { - dispose(fNSPrintInfo); + synchronized (fNSPrintInfoLock) { + if (fNSPrintInfo != -1) { + dispose(fNSPrintInfo); + } + fNSPrintInfo = -1; } }