新手请教,代码中的new为何没有对应的delete
void CMultiTaskDlg::OnNewTask() //对话框上的按钮{
//创建新任务
CThreadParam* pParam = new CThreadParam;
pParam->pDlg = this;
int nCount = m_TaskList.GetItemCount();
int nPos = m_TaskList.InsertItem(nCount, "任务", 0);
CString szText;
szText.Format("任务%d", nPos);
m_TaskList.SetItemText(nPos, 0, szText);
m_TaskList.SetItemText(nPos, 2, "进行中...");
pParam->nPos = nPos;
pParam->hHandle = CreateThread(NULL, 0, TaskProc, pParam, 0, NULL);
m_HandleList.AddHead(pParam);
}
每次点击按钮,都新调用CThreadParam* pParam = new CThreadParam;为何没有对应的delete