|
Game failure at return 0; at the end of the main loop |
Miles Lombardi
Member #5,876
May 2005
|
My game is pointer erroring at the return 0; at the end of the main loop. But why would it pointer error there? |
X-G
Member #856
December 2000
|
Because you're a bad, bad person and are not showing us any damn code. -- |
Miles Lombardi
Member #5,876
May 2005
|
Well i wouldn't have a clue waht to show you: main: int main() { init(); while (run) loop(); deinit(); return 0; } That's a bit useless. You see the problem occurs at return 0; So where am i supposed to show you? loop: void loop(){ if (key[KEY_ESC]) game_exit(); if (room == cRoom->id){ cRoom->constructor(); while (room == cRoom->id){allrooms(); cRoom->exec(); } cRoom->destructor(); } else cRoom = rooms[room - 1]; } The current constructor exec and destructor:
It was those destroy_bitmaps() that I added as I realised I'd forgotten to do that. |
Hrvoje Ban
Member #4,537
April 2004
|
Make sure that you're not destroying any bitmaps in global objects destructors. |
ReyBrujo
Moderator
January 2001
|
Are you destroying all the bitmaps, like sbuffer? -- |
Evert
Member #794
November 2000
|
Are you setting free'ed pointers to NULL? |
Miles Lombardi
Member #5,876
May 2005
|
It's this: |
|