Fix memory leak and make freeing bitmaps that might be cached a little safer.

svn path=/trunk/netsurf/; revision=6620
This commit is contained in:
Chris Young 2009-02-25 20:09:33 +00:00
parent 781405d195
commit 10d3cff743

View File

@ -402,6 +402,11 @@ bool ami_bitmap(int x, int y, int width, int height,
BLITA_UseSrcAlpha,!bitmap->opaque,
TAG_DONE);
if(tbm != bitmap->nativebm)
{
p96FreeBitMap(tbm);
}
return true;
}
@ -413,11 +418,6 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
int max_width,max_height;
struct BitMap *tbm = NULL;
/*
SetRPAttrs(currp,RPTAG_BPenColor,p96EncodeColor(RGBFB_A8B8G8R8,bg),
TAG_DONE);
*/
if(!(repeat_x || repeat_y))
return ami_bitmap(x, y, width, height, bitmap, bg, content);
@ -457,7 +457,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
break;
}
if(!option_cache_bitmaps)
if(tbm != bitmap->nativebm)
{
p96FreeBitMap(tbm);
}