Memory Leak in selection and a crash bug where a stack varible is being deleted.

This commit is contained in:
rods%netscape.com 1998-08-06 19:28:44 +00:00
parent 492873494d
commit 5fccb3fd81

View File

@ -628,7 +628,7 @@ char * TextFrame::CompressWhiteSpace(char * aBuffer,
char* s = aBuffer;
PRInt32 maxLen = end - cp;
if (maxLen > aBufSize) {
s = new char[maxLen];
s0 = s = new char[maxLen];
aShouldDeleteStr = PR_TRUE;
}
@ -1096,7 +1096,7 @@ TextFrame::PaintRegularText(nsIPresContext& aPresContext,
if (endPnt->GetOffset() == mContentOffset+mContentLength) {
endOffset = compressedStrLen;
} else {
if (endPnt->GetOffset() == compressedStrLen) {
if (endPnt->GetOffset() == (PRInt32)compressedStrLen) {
endOffset = compressedStrLen;
} else {
endOffset = indexes[endPnt->GetOffset()-mContentOffset]-mContentOffset;
@ -1611,6 +1611,10 @@ void TextFrame::CalcCursorPosition(nsIPresContext& aCX,
aOffset = i;
aWidth = width;
if (shouldDelete) {
delete compressedStr;
}
}
NS_IMETHODIMP