If quitting of the program is requested by pressing the <esc> key while the main frame has focus, a confirm message dialog is always presented to allow quitting to proceed or be cancelled.
If the state of the cube has changed since the last time the state was saved or, if no saving of state has occurred, since being initially set by the Cube State dialog, a message dialog appears asking the user "Do you want to save changes you made to cube state before you quit the program".