[AD] Problem with src/dispw:_register_switch_bitmap()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi all.

I have a problem with _register_switch_bitmap() and I am not sure where to
fix it.

When a user program calls gfx_set_mode(), it ends up calling an internal
_gfx_set_mode() which ends up calling _register_switch_bitmap() with the
bitmap that it has created for the screen.  However, nothing ever calls
_unregster_switch_bitmap() on this bitmap, so when I shutdown I get a
memory leak error from my memory tracker.

I have put a call in shutdown_gfx() but I'm not sure if this is the right
place.  Comments?  Patch attached.

-- 
/-------------------------------------------------------------------\
[Hitman/Code HQ - 6502/z80/68000/604e/80x86/ARM coder - Amiga rulez!]
[VZ-200/VIC-20/MZ-700/c16/c64*10/c128*8/Plus-4/CPC464/CD32/500*2    ]
[600/1000/1200*2/A4000/SNES/N64/Dreamcast/Athlon 1100/AmigaOne      ]
[Assembly Language: The most fun you can have with your clothes on! ]
\-------------------------------------------------------------------/
--- src/graphics.c	(revision 10978)
+++ src/graphics.c	(working copy)
@@ -455,6 +455,8 @@
  */
 static void shutdown_gfx(void)
 {
+   _unregister_switch_bitmap(screen);
+
    if (gfx_driver)
       set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/