Ticket #1856 (closed defect: invalid)

Opened 6 years ago

Last modified 5 years ago

A exit hack

Reported by: bdezonia Owned by: curtis
Priority: major Milestone: imagej2-b8-analysis
Component: Core Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1457

Description

In order to always exit safely even if plugin writers do not dispose their windows correctly we can have a catch all close routine. Thus, though hacky, we can avoid System.exit(). I have created such a hacky hack on the exit-hack branch.

Change History

comment:1 Changed 6 years ago by bdezonia

  • Blocking 1563 added

comment:2 Changed 6 years ago by bdezonia

  • Blocking 1457 added; 1563 removed
  • Milestone changed from imagej2-b7-ndim-data to imagej2-b8-analysis

comment:3 Changed 5 years ago by curtis

  • Status changed from new to closed
  • Resolution set to invalid

The main purpose of avoiding System.exit is to avoid touching state within the JVM that doesn't "belong" to ImageJ. Unfortunately, iterating through all open windows would potentially affect "non-ImageJ" objects within the JVM. While it is conceivable we could somehow listen for all window creations and determine whether each one is "ImageJ-related" and then dispose only those, it would be a lot of work just to work around other people's bugs.

For quitting, if we are going to end up touching global state anyway, I'd rather ImageJ just call System.exit(0) since it is much simpler. There is also a user option for whether to call System.exit IIRC. In any case, this hack unfortunately won't do the job.

Note: See TracTickets for help on using tickets.