[AD] Patch to unregister switch bitmap in src/graphics.c (4.3.10)

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


Hi all.

When a client program calls set_gfx_mode(), it ends up calling
_set_gfx_mode(), which adds the bitmap created to represent the screen to a
list of "switch" bitmaps.  But it never removes it, which results in a
memory leak.  Please find attached a patch to remove this bitmap from the
"switch" list in shutdown_gfx().

-- 
/-------------------------------------------------------------------\
[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 10988)
+++ 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/