c++ - Delete pointer memory and confirm it -


considering following:

tbmodelhframe = new tbmodelheaderframe(this, storage->getdatabase()); 

i guess correct way delete tbmodelhframe memory be

delete tbmodelhframe; 

right?

how check memory released?

yes, allocated new should freed delete. way check if every dinamically allocated memory has been freed use valgrind's memcheck

anyway, safer use smart pointers (see here).


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -