The fix for the nsCharSetProber class declaration, plus fix for
nsUniversalDetector methods, which may cause another leak when the object is
reused after Reset().

Patch proposed by Takayuki Tamura
r=shanjian, sr/a=brendan
This commit is contained in:
shanjian%netscape.com 2005-11-02 16:57:03 +00:00
Родитель 0ee918bf32
Коммит cf2986f7a8
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -50,6 +50,7 @@ typedef enum {
class nsCharSetProber {
public:
virtual ~nsCharSetProber() {};
virtual const char* GetCharSetName() = 0;
virtual nsProbingState HandleData(const char* aBuf, PRUint32 aLen) = 0;
virtual nsProbingState GetState(void) = 0;

Просмотреть файл

@ -89,7 +89,6 @@ nsUniversalDetector::Reset()
mDone = PR_FALSE;
mBestGuess = -1; //illegal value as signal
mInTag = PR_FALSE;
mEscCharSetProber = nsnull;
mStart = PR_TRUE;
mDetectedCharset = nsnull;
@ -148,8 +147,10 @@ void nsUniversalDetector::HandleData(const char* aBuf, PRUint32 aLen)
mInputState = eHighbyte;
//kill mEscCharSetProber if it is active
if (mEscCharSetProber)
if (mEscCharSetProber) {
delete mEscCharSetProber;
mEscCharSetProber = nsnull;
}
//start multibyte and singlebyte charset prober
if (nsnull == mCharSetProbers[0])