Pickle
Mega GP Mania
This is for those C++ experts out there. I understand class's and that there is a destructor that is called when the class is out of scope. What if there is a pointer to that class, can i just delete the pointer and all of the memory is free? Heres what im doing:
Declare the pointer
CODE
CGraphic* gfxCrew = NULL;
Assign the pointer
CODE
else if( strLine.find("#crew_gfx") == 0 ) gfxCrew = new CGraphic( ReadGraphicParameters( strLine ) );
delete the poiner
CODE
delete gfxCrew;
Can the class mempry be reclaimed?
Declare the pointer
CODE
CGraphic* gfxCrew = NULL;
Assign the pointer
CODE
else if( strLine.find("#crew_gfx") == 0 ) gfxCrew = new CGraphic( ReadGraphicParameters( strLine ) );
delete the poiner
CODE
delete gfxCrew;
Can the class mempry be reclaimed?