How to register callback when Arbortext is truly exiting
Product: PTC Arbortext Editor 8.2.2.1
The documentation for the session_add_callback and how the 'quit' callback function is invoked is confusing with regard to how the quit code is documented. I need the ability to do some proper cleanup with Arbortext process is closing, but not sure how to reliable do this with a quit callback.
The code that is passed to the quit callback is 0, 1, 2, but some testing has shown that when called with a '0', the application may not fully exit if the user decides to cancel the quit (e.g. has unsaved edits). For example, the following scenario happens:
- I select Exit from the File menu while there is unsaved changes.
- My callback is called with code equal to 0. Since I do not know if the application is truly exiting, I have the callback do nothing.
- The Arbortext then pops up the do-you-want-to-save changes dialog.
- I cancel the dialog, so the application is still running.
- I choose exit again.
- Unsaved-changes dialog pops up again (my callback is NOT called).
- Choose to not save changes to exit application (again, my callback is NOT called).
After canceling the first dialog, my callback is not called again when the application truly exits., so I am unable to do proper cleanup. Is there any reliable way via ACL (or Java) to have a callback invoked when Arbortext is truly exiting, when the user no longer has options to cancel it.

