ptr_remove frees childobjects too ?

Posted By: gri

ptr_remove frees childobjects too ? - 09/28/12 09:11


he ho,

when removing a panel via ptr_remove so I have to care about its child elements before and remove them too?

Or got the memory of all the underlaying objects free'd through the nestet structur and removing the panel is enough ?
Posted By: Superku

Re: ptr_remove frees childobjects too ? - 09/28/12 09:48

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

BMAP* my_bmap = NULL;

void main()
{
	my_bmap = bmap_createblack(256,256,24);
	wait(1);
	while(1)
	{
		PANEL* pnl_test = pan_create(NULL,integer(random(9999)));
		pan_setbutton(pnl_test,0,0,150,130,my_bmap,NULL,NULL,NULL,NULL,NULL,NULL);
		ptr_remove(pnl_test);
		wait(1);
	}
}


Doesn't seem to leak any memory in the task manager.
Posted By: gri

Re: ptr_remove frees childobjects too ? - 10/01/12 06:12



hey thank you Superku for your efforts
© 2024 lite-C Forums