FreeText ()
{
if (HIWORD ((DWORD) m_pszText) != 0)
- delete m_pszText;
+ delete[] m_pszText;
}
TCHAR *pcNewBuf = new TCHAR[li.m_nMax];
if (li.m_nLength > 0)
memcpy (pcNewBuf, li.m_pcLine, sizeof (TCHAR) * li.m_nLength);
- delete li.m_pcLine;
+ delete[] li.m_pcLine;
li.m_pcLine = pcNewBuf;
}
memcpy (li.m_pcLine + li.m_nLength, pszChars, sizeof (TCHAR) * nLength);
for (int I = 0; I < nCount; I++)
{
if (m_aLines[I].m_nMax > 0)
- delete m_aLines[I].m_pcLine;
+ delete[] m_aLines[I].m_pcLine;
}
m_aLines.RemoveAll ();
int nDelCount = nEndLine - nStartLine;
for (int L = nStartLine + 1; L <= nEndLine; L++)
- delete m_aLines[L].m_pcLine;
+ delete[] m_aLines[L].m_pcLine;
m_aLines.RemoveAt (nStartLine + 1, nDelCount);
// nEndLine is no more valid
if (nRestCount > 0)
{
AppendLine (nStartLine, pszRestChars, nRestCount);
- delete pszRestChars;
+ delete[] pszRestChars;
}
if (pSource!=NULL)
}
if (pszRestChars != NULL)
- delete pszRestChars;
+ delete[] pszRestChars;
context.m_ptEnd.x = nEndChar;
context.m_ptEnd.y = nEndLine;
}
if (m_pszMatched)
{
- delete m_pszMatched;
+ delete[] m_pszMatched;
m_pszMatched = NULL;
}
//BEGIN SW
}
*/
//END SW
- delete anBreaks;
- delete pBuf;
+ delete[] anBreaks;
+ delete[] pBuf;
}
COLORREF CCrystalTextView::
}
if (m_pnActualLineLength != NULL)
{
- delete m_pnActualLineLength;
+ delete[] m_pnActualLineLength;
m_pnActualLineLength = NULL;
}
m_nParseArraySize = 0;
charPoint.y = i + 1;
int nReturnVal = (i >= 0)? anBreaks[i] : 0;
- delete anBreaks;
+ delete[] anBreaks;
return nReturnVal;
}
break;
}
}
- delete anBreaks;
+ delete[] anBreaks;
return nIndex;
}
ASSERT( nSubLineOffset >= 0 && nSubLineOffset <= nBreaks );
int nReturnVal = anBreaks[nSubLineOffset] - 1;
- delete anBreaks;
+ delete[] anBreaks;
return nReturnVal;
}
ASSERT( nSubLineOffset > 0 && nSubLineOffset <= nBreaks );
int nReturnVal = anBreaks[nSubLineOffset - 1];
- delete anBreaks;
+ delete[] anBreaks;
return nReturnVal;
}
nLimit += 32;
int *pnNewPages = new int[nLimit];
memcpy (pnNewPages, m_pnPages, sizeof (int) * m_nPrintPages);
- delete m_pnPages;
+ delete[] m_pnPages;
m_pnPages = pnNewPages;
}
ASSERT (nLimit > m_nPrintPages);
}
if (m_pnPages != NULL)
{
- delete m_pnPages;
+ delete[] m_pnPages;
m_pnPages = NULL;
}
m_nPrintPages = 0;
nIndex ++;
}
- delete anBreaks;
+ delete[] anBreaks;
ASSERT(nIndex >= 0 && nIndex <= nLength);
pt.x = nIndex;
for( int J = nBreaks - 1; J >= 0 && nCharIndex < anBreaks[J]; J-- );
nPreBreak = anBreaks[J];
}
- delete anBreaks;
+ delete[] anBreaks;
//END SW
for (int I = 0; I < nCharIndex; I++)
{
+2003-04-08 Kimmo
+ PATCH: [ 716744 ] Fix CrystalEditor memory leaks
+ editlib: ccrystaltextbuffer.cpp ccrystaltextview.cpp
+
2003-04-07 Kimmo
PATCH: [ 716308 ] Disable italic text
editlib: ccrystaltextview.cpp