sio2Free will make the memory leak????
2 posters
sio2Free will make the memory leak????
void sio2Free( void *_ptr )
{
unsigned int i = 0;
while( i != sio2memory->n_alloc )
{
if( _ptr == sio2memory->_SIO2meminfo[ i ]->ptr )
{
memcpy( &sio2memory->_SIO2meminfo[ i ],
&sio2memory->_SIO2meminfo[ i + 1 ],
( sio2memory->n_alloc - i ) * sizeof( SIO2meminfo * ) );
sio2memory->n_alloc--;
sio2memory->_SIO2meminfo = ( SIO2meminfo ** ) realloc( sio2memory->_SIO2meminfo,
sio2memory->n_alloc * sizeof( SIO2meminfo * ) );
break;
}
++i;
}
}
in the function , only free SIO2meminfo Node's memory ,but not free the point "ptr"'s memory
{
unsigned int i = 0;
while( i != sio2memory->n_alloc )
{
if( _ptr == sio2memory->_SIO2meminfo[ i ]->ptr )
{
memcpy( &sio2memory->_SIO2meminfo[ i ],
&sio2memory->_SIO2meminfo[ i + 1 ],
( sio2memory->n_alloc - i ) * sizeof( SIO2meminfo * ) );
sio2memory->n_alloc--;
sio2memory->_SIO2meminfo = ( SIO2meminfo ** ) realloc( sio2memory->_SIO2meminfo,
sio2memory->n_alloc * sizeof( SIO2meminfo * ) );
break;
}
++i;
}
}
in the function , only free SIO2meminfo Node's memory ,but not free the point "ptr"'s memory
terryc- Posts : 11
Join date : 2009-02-08
Re: sio2Free will make the memory leak????
Just use instruments with leaks, sio2_memory was written quickly back in the days when instruments was not as good as it is today
Similar topics
» leak of memory
» Particles System with a little memory leak...
» sio2PhysicInit memory consumption
» Memory problem in version 1.3.1?
» accelerometer (How can I make them work just the oposite?)
» Particles System with a little memory leak...
» sio2PhysicInit memory consumption
» Memory problem in version 1.3.1?
» accelerometer (How can I make them work just the oposite?)
Permissions in this forum:
You cannot reply to topics in this forum