(Solved)Memory Management in Qt Using Pointers



  • @int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    CMyClass *pObj = new CMyClass ;
    pObj ->show();
    return a.exec();
    }@
    According to rule allocate memory using new must deallocate using delete in order to manage memory leak,segfault etc.
    How should i use delete (deallocating) pointer *pObj inside main?Does it delete automatically.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.