Do I have to explicitly call System.exit() in a Webstart application?

后端 未结 5 1315
心在旅途
心在旅途 2021-01-12 04:49

Recently I converted a Swing application to Webstart. The process was pretty straightforward, but I found that after I close all windows, my application\'s JVM did not termi

5条回答
  •  轮回少年
    2021-01-12 05:36

    The AWT EDT is usually the culprit. For some years now it has had some logic to shutdown when there are no undisposed windows. However, there are recurrent problems with leaks, including within the implementation of AWT and Swing. Therefore, I strongly suggest using System.exit in production releases (you might possibly want to leave it out for some testing to detect leaks).

    The WebStart thread should all be daemon when there are no system windows (console, javax.jnlp services and other dialogs) showing.

提交回复
热议问题