jwfwessels / AFK

Automated Battle Ground.
MIT License
1 stars 1 forks source link

Resources not unloading when application exits. #8

Closed danini-the-panini closed 11 years ago

danini-the-panini commented 11 years ago

Description:

Resources are no longer being automatically unloaded when the application is closed using the close button or Alt-F4 or Command-Q or whatever.

Affects Area:

danini-the-panini commented 11 years ago

This is due to incorrect closing procedures in RootWindow. Replacing the window listener code with a simple setDefaultCloseOperation(EXIT_ON_CLOSE) will do the trick.

Alternately, instead of calling System.exit(0), you could tell the JFrame to clean itself up before exiting. This approach, while possibly more complex, will allow some control over what happens when the application is closed. For example, a popup window could prevent the user from accidentally closing the application.