i used the following code and couldn't reproduce the problem :

Code:
void putGolem()
{
	while(1)
	{
		wait(1);
	}
}

int main()
{
	level_load(NULL);
	wait(1);
	
	while(1)
	{
		ENTITY* enemy = ent_create(CUBE_MDL, vector(1,2,3), putGolem);
	
		ptr_remove(enemy);
		wait(1);
	}
}



I guess the memory leak is most likely hidden somewhere else ...


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread