LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Itun on April 18, 2011, 18:51:18

Title: How to destroy LWJGL application
Post by: Itun on April 18, 2011, 18:51:18
Occasionally there comes a time when my LWJGL application does not load and operation system returns the fatal error: Java Platform SE binary has stopped working. I suspect that this is because of I close my previous application not correctly.
This is how I destroy my application:

        theme.destroy(); // TWL theme destroy
        gui.destroy(); // TWL gui destroy
        Display.destroy();
        Keyboard.destroy();
        Mouse.destroy();
        System.exit(0);
Title: Re: How to destroy LWJGL application
Post by: kappa on April 18, 2011, 19:05:15
once you've called System.exit(0); you've killed the jre, you shouldn't really need it if you've finished all the running threads.

Also you don't need to call Keyboard.destroy() or Mouse.destroy() since Display.destroy() calls them for you.
Title: Re: How to destroy LWJGL application
Post by: Itun on April 18, 2011, 19:12:39
Quote from: kappa on April 18, 2011, 19:05:15
once you've called System.exit(0); you've killed the jre, you shouldn't really need it if you've finished all the running threads.
I know this, I don`t want to finish threads manually.
Quote from: kappa on April 18, 2011, 19:05:15
Also you don't need to call Keyboard.destroy() or Mouse.destroy() since Display.destroy() calls them for you.
Thank you, may be something else.