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 ]


On 01/10/2008, you wrote:
> 
>> 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 ()

Hmmm, you are right.  And removing my change doesn't result in a memory
leak.  And yet it did and I tracked it down to src/dispw.c and the patch
fixed it!  Maybe I'm going mad.  I'll keep an eye out for it, cheers.

-- 
/-------------------------------------------------------------------\
[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! ]
\-------------------------------------------------------------------/





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