Originally Posted By: Ayumi
Quote:
For example, if a button has an image, the allocated memory of the image will be also released automatically?


No,..this depend on your Pointer.

Panel.bmap = bmap_create(...); -> This Image will be removed if the panel is deleted

----

BMAP* bmp = bmap_create(...);
Panel.bmap = bmp; -> This Image will not be removed if the panel is deleted (because BMAP Pointer is global)


I would bet that is wrong. I think the engine removes nothing but the globally declared stuff. You must remove everything you create by any of the '..._create' functions and, of course, all you allocate with 'sys_malloc'.

Code:
BMAP *gbBmp = "myImage.tga"; // This image is allocated and released by the engine automatically as far as ir is declared globally.
PANEL *gbPan =  {
   bmap = bgBmp; // This image will be removed as far as it is allocated in the program start by the engine, as happens with the PANEL struct.
   window(200,0,40,20,"compass.pcx",compass_pos.x,compass_pos.y); // 'compass.pcx' will also be released when the panel is removed.
};
function myFnc() {
   gbPan.bmap = bmap_create("myImage.tga"); // This image is not automatically released by the engine, does not matter where you save its reference. You must remove it when you are done.
}