I am new to javaFX and I am working on a desktop application. In a few words this application communicates with a server through rest (there is an autentication system). I want to communicate to the server the "logout" before every possible case of app closing. For now, i wrote this snippet in Application class:
@Override
public void stop(){
Session.logout();
}
And it helps me to communicate the logout if the application is closing. But, for example, if I close the application from the IDE (I know that i n production it is not possible), the application does not fire the stop() method. The same is if I force the application to close from the OS. Is there anything to prevent the involuntary close of the application?