关于析构函数回收内存的有关问题

关于析构函数回收内存的问题
我定义的类如下:
C/C++ code

class Father
{
    
public:

    Father(char* str="NoName");//默认构造函数显示声明
    Father(const Father& f);//默认复制构造函数显示声明,必须显示声明,进行深度复制才能解决多个指针指向同一内存区域的问题
    virtual~Father();
    static int m_nCount;//静态成员,记录当前对象的数目
    virtual void ShowCount()const;//显示当前对象数目
    virtual void Show()const;//显示当前对象的信息
    friend ostream& operator<<(ostream& os,Father& f);
private:
    char* pName;//对象名
    int m_nLength;//对象名的长度

};
int Father::m_nCount=0;
ostream& operator<<(ostream& os,const Father& f)
{
    f.Show();
    return os;
}
Father::Father(char* str):pName(NULL)//将指针初始化为NULL,避免产生野指针
{
    cout<<"Father类的默认构造函数被调用"<<endl;
    m_nCount++;
    m_nLength=strlen(str);
    pName=new char[m_nLength+1];
    //strcpy(pName,str);//strncpy,memcpy等也可以实现
    memcpy(pName,str,m_nLength);
    pName[m_nLength+1]='\0';//字符串结尾标志
}
Father::Father(const Father& f)//深度复制deep copy
{
    cout<<"Father类的复制构造函数被调用"<<endl;
    m_nCount++;
    m_nLength=f.m_nLength;
    pName=new char[m_nLength+1];
    //strcpy(pName,f.pName);
    memcpy(pName,f.pName,m_nLength);
    pName[m_nLength+1]='\0';
}
Father::~Father()
{
    cout<<"Father类的析构函数被调用"<<endl;
/*    if(pName!=NULL)
    {
        delete pName;
        pName=NULL;
    }*/
    m_nCount--;
}


申请了内存,析构时不是要释放么,不然会产生内存泄露
但是实际情况是,我把析构函数的回收内存代码注释掉,程序正常运行
不注释的话,运行出来会发出“蹦”的响声,而且控制台关闭没反应
这是为什么呢?


------解决方案--------------------
delete [] pName应该这么释放的,
------解决方案--------------------
pName[m_nLength+1]='\0';这里有错,应该为pName[m_nLength]='\0';否则释放会出错
------解决方案--------------------
pName[m_nLength+1]已经越界了

就像 int a[3]={1,2,3};
a[3]=5;//下标越界
------解决方案--------------------
探讨

引用:
pName[m_nLength+1]='\0';这里有错,应该为pName[m_nLength]='\0';否则释放会出错

修改了下,的确是这样
但是不明白,为什么呢?
申请了m_nLength+1个内存空间,那么pName[m_nLength+1]里面是什么呢?