Memory leaks, continue

Posted By: VeT

Memory leaks, continue - 07/02/09 12:41

when i diselect entity, i call function
Code:
void HlSpriteHideModel(ENTITY* ent)
{	
	if (ent.sHandSprt != NULL)
	{
		ENTITY* sprEnt = ptr_for_handle(ent.sHandSprt);
		ent_remove(sprEnt);
		ent.sHandSprt = NULL;
	}
}



if i comment this function's call, number of functions on the debug panel is 18 and it undepends from how many times i select/diselect bots

if i uncomment this function's call, number of functions increased depending on unmber of times, when i diselect entity

why this function can do that, i dont have loops there?
Posted By: Damocles_

Re: Memory leaks, continue - 07/02/09 12:46

can you try:

Code:
void HlSpriteHideModel(ENTITY* ent)
{	
	if (ent.sHandSprt != NULL)
	{
		ENTITY* sprEnt = ptr_for_handle(ent.sHandSprt);
             ent.sHandSprt = NULL;		
             ent_remove(sprEnt);
		
	}
}



switching it around,
maybe it does not get removed (keeps in memory) before the
stored pointer in the eneity is set to null..
Posted By: VeT

Re: Memory leaks, continue - 07/02/09 12:53

hmmm... swap those strings , but its still increase frown
Posted By: VeT

Re: Memory leaks, continue - 07/02/09 12:59

ah, i found error
in the closest view, another function calls loop... Damocles, thanks for help smile
Posted By: Damocles_

Re: Memory leaks, continue - 07/02/09 12:59

no problem wink
Posted By: jcl

Re: Memory leaks, continue - 07/02/09 13:07

I see that a debug feature to display all currently running functions is highly desirable to find such multitasking-related errors. This will be implemented with high priority.
Posted By: pegamode

Re: Memory leaks, continue - 07/02/09 13:18

That's great news ... that would help us very much in our current project.
Posted By: Damocles_

Re: Memory leaks, continue - 07/02/09 13:35

maybe with a "dump" function, that
saves the names and number of active functions to a log-file at a
specific time.
Posted By: VeT

Re: Memory leaks, continue - 07/02/09 13:46

Quote:
I see that a debug feature to display all currently running functions is highly desirable to find such multitasking-related errors. This will be implemented with high priority.


yeahh! smile
© 2024 lite-C Forums