kewnt
08/07/2008, 20h15
hi.
i need to load multiple images, one after another and it looks like there's a memory leak somewhere... maybe you can advise me ob where should i do some free()-s?
for now i just load images w/ ulLoadImageFilePNG and do not make any free().
like this:
if(updated) {
updated=0;
readsizes(coords[2][0]);
a=readimg(coords[2]);
maps[2]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
a=readimg(coords[3]);
maps[3]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
readsizes(coords[1][0]);
a=readimg(coords[1]);
maps[1]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
a=readimg(coords[0]);
maps[0]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
}
thanks!
i need to load multiple images, one after another and it looks like there's a memory leak somewhere... maybe you can advise me ob where should i do some free()-s?
for now i just load images w/ ulLoadImageFilePNG and do not make any free().
like this:
if(updated) {
updated=0;
readsizes(coords[2][0]);
a=readimg(coords[2]);
maps[2]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
a=readimg(coords[3]);
maps[3]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
readsizes(coords[1][0]);
a=readimg(coords[1]);
maps[1]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
a=readimg(coords[0]);
maps[0]=ulLoadImageFilePNG((void *)buf, (int)a, UL_IN_VRAM, UL_PF_PAL8);
}
thanks!