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

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


Colin Ward wrote:
Hi all.

Resending this as it didn't seem to get through this morning.

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().

It is removed:

#0  _unregister_switch_bitmap (bmp=0x8135bc8) at ./src/dispsw.c:277
#1  0x080728dc in destroy_bitmap (bitmap=0x8135bc8) at ./src/graphics.c:1470
#2 0x08071034 in _set_gfx_mode (card=-1, w=0, h=0, v_w=0, v_h=0, allow_config=-1) at ./src/graphics.c:670 #3 0x08070e7a in set_gfx_mode (card=-1, w=0, h=0, v_w=0, v_h=0) at ./src/graphics.c:611
#4  0x08070ab1 in shutdown_gfx () at ./src/graphics.c:459
#5  0x0805bcd7 in allegro_exit () at ./src/allegro.c:459
#6  0x0805b956 in allegro_exit_stub () at ./src/allegro.c:289
#7  0xb7dcfc24 in exit () from /lib/libc.so.6
#8  0xb7db8398 in __libc_start_main () from /lib/libc.so.6
#9  0x0805a761 in _start ()



--
Milan Mimica
http://sparklet.sf.net




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