Memory Issue in Game

I am currently programming a game with ALLEGRO 5, but I am having a problem with the size of my game which initiates all the images once and destroys the images all at once after the game loop.

When I exit the game it crashes because the virtual memory is overloaded. What I want to know is how do I structure the game so that every time the character moves to a new map screen it destroys all the old images.

Topic archived. No new replies allowed.