mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Memory Leak in selection and a crash bug where a stack varible is being deleted.
This commit is contained in:
parent
492873494d
commit
5fccb3fd81
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user