How to properly destroy() / exit() the app for Windows to shut up?

Hi, whenever I exit my app on Windows 7 I get a screen like this, sorry it’s not the right program name, but you know that screen where it basically asks the user if the program ran correctly or if they want to retry using compatibility mode?

Here’s how I exit the app:

public void destroy(){
// … lots of cleanup here… and then:

I tried to call super.destroy(); before exiting in case I was missing to execute some important cleanup tasks that were overridden with my version of the destroy() function, but it does the same thing. Any ideas?


exit(0) => no error
exit(x) with x != 0 => error x

But you should not need to call System.exit().

1 Like

DOH! Thx :stuck_out_tongue: It works… silly me haha! >.< +1’ed you :smiley:

@david.bernard.31 said: But you should not need to call System.exit().

In some different situations, I am exiting the app prematurely, that’s why I wanted to make sure I was calling the System.exit() correctly. Thx

Hm it depends there are some situations (mostly crashed render cycle) where a System.exit is a good solution.