Exit code -1 upon closing window

Anything libgdx related goes here!

Exit code -1 upon closing window

Postby Zoulz » Tue Aug 13, 2019 7:01 pm

Hey there, i'm getting:
Code: Select all
Execution failed for task ':desktop:DesktopLauncher.main()'.
> Process 'command 'C:/Program Files/Java/jdk1.8.0_221/bin/java.exe'' finished with non-zero exit value -1

After I close the window that is opened by the DesktopLauncher. I'm running in IDEA 2019.1.4 community and gradle seems to build everything just fine. I guess it's not the end of the world, but it still annoys me because I can't understand why. Is the application not closed properly when you close the window (X)?
Posts: 1
Joined: Tue Aug 13, 2019 6:51 pm

Re: Exit code -1 upon closing window

Postby shatterblast » Tue Aug 13, 2019 9:19 pm

It is possible and very likely that one of your LibGDX-specific objects are not properly disposed. They are designed to stay in memory, because with mobile games, it would cause the game to crash each time if someone took a call or switched apps. You might look into using AssetManager, because it covers most scenarios. In my own design though, I find that I need to manually call Music#dispose(). If left rampant, an un-disposed object causes a memory leak. The JVM can gradually recover at least, but the leaks easily stack until removed.
Posts: 368
Joined: Sun Jul 06, 2014 1:14 pm

Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest