PDA

View Full Version : ShutGameAPI runtime error


zehlein
11-17-2006, 08:41 PM
Did anybody encounter runtime errors while calling the ShutGameAPI function? This drives me mad: If I call the ShutGameAPI function via a WM_Close message from one point of the program it works fine. From another point it throws me a runtime error. Well, that is important, for it is the End Of Game Screen that does not work because of this... :((

kornalius
11-18-2006, 12:14 AM
You need to shut it in the WM_CLOSE. The reason is because during your other part of the program, the buffer is probably still being accessed.

Try doing a G_Update() before the ShutGameAPI. This could help.

zehlein
11-18-2006, 06:53 AM
I do it via
PostMessage(hWnd$, WM_CLOSE, 0, 0);
and the WM_CLOSE in MainProc$ calls the ShutGameAPI function. The G_Update() doesn't help here. Anything else I could do?

kornalius
11-19-2006, 03:47 PM
ShutGameAPI tries to free the memory occupied by the sprites and does many other cleanup, maybe there is something in your code that prevents it from shutting down normally.

Send me your code I will take a look.

zehlein
11-19-2006, 06:07 PM
Done and thx.

kornalius
11-19-2006, 08:07 PM
Thanks will look into it soon.