Looking at my program in task manager (on Windows 7), I noticed that every time I toggle windowed fullscreen, the memory of the program jumps up significantly. It jumps up by around 27 mb each time I toggle to and from windowed fullscreen, and never goes back down.
If I switch in and out until the program uses more than 512 mb, it crashes! It only takes about 16 toggles before crashing
The only thing I do when toggling is call this:
al_toggle_display_flag(display, ALLEGRO_FULLSCREEN_WINDOW, fullscreen);
Could it be creating a new backbuffer bitmap and not destroying the old one?
EDIT: This happens in openGL mode, it doesn't seem to occur in direct3d. That being said I'm using openGL, so switching is not a solution.