< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java

Print this page

        

@@ -176,16 +176,10 @@
 
         if (attributes == null) {
             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);
             // If rangeSelect is not null, we are using AWT's print dialog that has
             // All, Selection, and Range radio buttons

@@ -561,13 +555,16 @@
 
     // The following methods are CPrinterJob specific.
 
     @Override
     protected void finalize() {
+        synchronized (fNSPrintInfoLock) {
         if (fNSPrintInfo != -1) {
             dispose(fNSPrintInfo);
         }
+            fNSPrintInfo = -1;
+        }
     }
 
     private native long createNSPrintInfo();
     private native void dispose(long printInfo);
 
< prev index next >