deleteLater函数和通用的delete有何区别?
SMSUIMessageEditor在一个地方new出来,但这个new出来的对象,却不是用delete来销毁的。用了个看不懂的deleteLater。
deleteLater、delete这两者有什么区别呢?
m_pMessageEditor = new SMSUIMessageEditor (this);void SMSUIMainDlg::onCloseNewMsgDialog (){ qDebug ("%s: %s: Entered", __FILE__, __FUNCTION__); QObject* pObj = QObject::sender (); if (NULL == pObj) { qDebug ("%s: %s: %s %d pObj is NULL ", _TIME_, __FILE__, __FUNCTION__, __LINE__); return; } SMSUIMessageEditor *pDlg = qobject_cast<SMSUIMessageEditor *>(pObj); if (NULL != pDlg) { pDlg->m_pwidgetcreateDlg->deleteLater (); pDlg->deleteLater (); } qDebug ("%s: %s: Exit", __FILE__, __FUNCTION__);}