JDK-4844504 : PIT: printing application does not exit
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.1
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-04-07
  • Updated: 2003-04-21
  • Resolved: 2003-04-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
This application never exits.
----------------------------------------------------------
import java.awt.*;
import java.awt.print.*;

class PrintDlgAWT {

    public static void main(java.lang.String[] args) {
          PrintJob PJ = Toolkit.getDefaultToolkit().getPrintJob(
                        new Frame(),"Testing Exit", null,null);

    }

}
----------------------------------------------------------------------

###@###.### wrote:

> It turns out there's an old bug
> "4515058 application does not exit after printing"
> on exactly this isssue was closed as "will not fix" out of confusion
> that input method contexts were the issue. Perhaps in that case they
> were somehow involved, but I see no evidence of that - it just looks 
> like an AWT bug.
> 
> I've attached the Ctrl-Break output to see if it tells anyone anything
> beyond the obvious that the non-daemon thread AWT-EventQueue-0 is still
> running.
> 

See attachments.

Praveen Mohan found this bug while testing it on the 2D PIT build:
/net/capra/export12/java2d/builds/01-Apr-03.tiger

###@###.### 2003-04-08

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b05
14-06-2004

EVALUATION Should figure out what the root cause is and try to address for Tiger. ###@###.### 2003-04-07 Name: dsR10078 Date: 04/08/2003 The automatic AWT shutdown is triggered when all three conditions are true: 1.There are no non-disposed peers. 2.There are no events in the native event queue. 3.There are no events in java event queues. In this case the application doesn't exit automatically, since there is a non-disposed peer. The Frame passed to the Toolkit.getPrintJob() is used as a parent for the print dialog. The Frame peer is created when the dialog is shown in the printing code, but it is never disposed. The frame should be disposed in order to allow automatic AWT shutdown. I verified that the following modified test exits after the print dialog is closed: ----------------------------------------------------------------- public static void main(java.lang.String[] args) { Frame f = new Frame(); PrintJob PJ = Toolkit.getDefaultToolkit().getPrintJob( f,"Testing Exit", null,null); f.dispose(); } ----------------------------------------------------------------- ###@###.### 2003-04-08 ====================================================================== Thanks. Will dispose frames. ###@###.### 2003-04-08 =====================================
08-04-2003