Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit improves how we clean up the gateway once the UI is closed in gui mode. Although it is highly unlikely, it is possible for a user to run into a NameError when deleting the gateway if a user enters gui mode but is NOT on macos and successfully exits the gui without crashing the session (see next below, this requires some playing around). This is resolved by assigning the gateway to None, ensuring there is *something* to delete if no gateway object is assigned. This commit also adds an additional check for a running JVM instance when in gui mode on non-macos systems. This prevents a `jpype._core.JVMNotRunning: Java Virtual Machine is not running` error that is produced when the imagej ui visbility is polled but is no longer available because the JVM has been shut down via gui interactions.
- Loading branch information