如题?

解决方案 »

  1.   

    内存泄漏一般来说是内存分配了没释放。
    可以考虑使用smart pointer
      

  2.   

    需要你具体的代码!
    /////////////////
    new
    deletenew[]
    delete[]
    配对
      

  3.   

    new和delete成对出现
    申请了资源,就要释放
      

  4.   

    http://lijinshui.blogchina.com/blog/article_75070.316004.html
      

  5.   

    typedef struct testChar
    {
    char * ch1;
    char * ch2;
    }*PCHAR;PCHAR p = new PCHAR;
    p->ch1 = new char[10];
    p->ch2 = new char[10];if(p->ch1 != NULL)
       delete[] p->ch1;
    if(p->ch2 != NULL)
       delete[] p->ch2;delete p;