Ending process after exit

BlitzMax Forums/BlitzMax Beginners Area/Ending process after exit

Czar Flavius(Posted 2007) [#1]
My game remains in the task manager process lists after I exit it and I have to end it manually.

My game loop is this:
Local terminate:Int = False
Repeat
	Cls
	game.drawGame()
	game.update()
	Flip
terminate = KeyDown(KEY_ESCAPE) Or AppTerminate()
Until terminate
End


What am I doing wrong?


MGE(Posted 2007) [#2]
Taking out the game.Draw, game.Update calls does it still behave the same?


Czar Flavius(Posted 2007) [#3]
Yes.


Yahfree(Posted 2007) [#4]
try switching keydown to Keyhit, just an idea..


Czar Flavius(Posted 2007) [#5]
No change.

It's really upsetting because otherwise my game is nearly finished, and I can't figure out what is causing this :(


Dreamora(Posted 2007) [#6]
What is in the draw and update?
What exactly does your game use?

PUB.FreeProcess for example?
Or are you using MaxGUI and a window

Above Code will quit the process when done.


Czar Flavius(Posted 2007) [#7]
Here my code. Here's it all!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

http://co-project.lboro.ac.uk/users/phnk/blitzmax/


Dreamora(Posted 2007) [#8]
Don't see any reason it should run further.
Sample code at the beginning works, your project can't be tested due to missing includes but from the sources I've not seen any reason why it should continue.
But to make sure: call an EndGraphics before calling end.

Sounds like an issue with your system or an installed software / driver


TaskMaster(Posted 2007) [#9]
Are you calling anything external, like a dll or a call to some C++ code that needs to be deleted or shutdown in a specific manner?


Czar Flavius(Posted 2007) [#10]
EndGraphics doesn't fix it.

I should now have all the files (and the image file) on that link.. if people could try out my program and see if they have the same problem that would be great. Look for main.exe in the processes list after exiting the game.

No DLL or C++ is being called.


Dreamora(Posted 2007) [#11]
Nope finishs correctly here on my BM 1.26, XP Pro SP2 system


What OS do you have?
I assume one of those supported or at least accepted today (Win2k and newer), because with Win98 / WinME this might just be one of those many many process handling issues that actually declared its uselessness back then to any real computer user.


Azathoth(Posted 2007) [#12]
The only problem I had was that "block.png" wouldn't load because you had no Import brl.PNGLoader


Czar Flavius(Posted 2007) [#13]
I have Windows XP. Something odd must be happening, because even without the Import it still loads the png file fine :S I'm using Blide if that makes any difference.

Edit: I have uploaded the exe that I compile on my computer. This exe remains in processes after I quit it. Same for you?

Edit: Ok this makes it a bit stranger, but maybe a bit more logical. I just downloaded the main.exe from there and it doesn't do this. If I run the main.exe from the project folder it does it, but copying the same exe to another folder stops this from happening. Any ideas why this might be? I'm thinking something to do with Incbin maybe, as the original file it Incbins is in the project folder.


ziggy(Posted 2007) [#14]
The sound driver can take a while to end on some computers. Wait and see if it remains 'forever' or just for a little while