Commit a6457f83 authored by Sven Strickroth's avatar Sven Strickroth

delete is a noop for nullptr

Signed-off-by: Sven Strickroth's avatarSven Strickroth <email@cs-ware.de>
parent 1a6d8d3c
......@@ -199,11 +199,8 @@ CTortoiseGitBlameView::~CTortoiseGitBlameView()
DeleteObject(m_italicfont);
#ifdef USE_TEMPFILENAME
if(m_Buffer)
{
delete m_Buffer;
m_Buffer=NULL;
}
delete m_Buffer;
m_Buffer = nullptr;
#endif
}
struct EncodingUnit
......@@ -1579,11 +1576,8 @@ void CTortoiseGitBlameView::UpdateInfo(int Encode)
}
#ifdef USE_TEMPFILENAME
if(m_Buffer)
{
delete m_Buffer;
m_Buffer=NULL;
}
delete m_Buffer;
m_Buffer = nullptr;
CFile file;
file.Open(this->GetDocument()->m_TempFileName,CFile::modeRead);
......
......@@ -137,8 +137,7 @@ void CCheckForUpdatesDlg::OnDestroy()
for (int i = 0; i < m_ctrlFiles.GetItemCount(); ++i)
delete (CUpdateListCtrl::Entry *)m_ctrlFiles.GetItemData(i);
if (m_updateDownloader)
delete m_updateDownloader;
delete m_updateDownloader;
CStandAloneDialog::OnDestroy();
}
......
......@@ -87,10 +87,7 @@ CCommitDlg::CCommitDlg(CWnd* pParent /*=NULL*/)
CCommitDlg::~CCommitDlg()
{
if(m_pThread != NULL)
{
delete m_pThread;
}
delete m_pThread;
}
void CCommitDlg::DoDataExchange(CDataExchange* pDX)
......
......@@ -68,10 +68,7 @@ CGitProgressList::~CGitProgressList()
{
delete m_arData[i];
}
if(m_pThread != NULL)
{
delete m_pThread;
}
delete m_pThread;
}
......
......@@ -71,10 +71,7 @@ CProgressDlg::CProgressDlg(CWnd* pParent /*=NULL*/)
CProgressDlg::~CProgressDlg()
{
if(m_pThread != NULL)
{
delete m_pThread;
}
delete m_pThread;
}
void CProgressDlg::DoDataExchange(CDataExchange* pDX)
......
......@@ -309,11 +309,9 @@ BOOL CMailMsg::Send()
m_sErrorMsg.Format(_T("MAPISendMail has failed with code %lu."), status);
}
if (pRecipients)
delete [] pRecipients;
delete[] pRecipients;
if (nAttachments)
delete [] pAttachments;
delete[] pAttachments;
return (SUCCESS_SUCCESS == status);
}
......
......@@ -87,10 +87,8 @@ CSciEdit::~CSciEdit(void)
m_personalDict.Save();
if (m_hModule)
::FreeLibrary(m_hModule);
if (pChecker)
delete pChecker;
if (pThesaur)
delete pThesaur;
delete pChecker;
delete pThesaur;
}
static std::unique_ptr<UINT[]> Icon2Image(HICON hIcon)
......
......@@ -156,10 +156,7 @@ BOOL CHyperLink::ConvertStaticToHyperlink(HWND hwndParent, UINT uiCtlId,
*/
BOOL CHyperLink::setURL(LPCTSTR strURL)
{
if( m_strURL )
{
delete [] m_strURL;
}
delete[] m_strURL;
if( (m_strURL = new TCHAR[lstrlen(strURL)+1])==0 )
{
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment