#60908 changing character-coding-->auto-detect appears to leak memory

r=ftang sr=be
Replaced owning com prt with raw ptr (weak ref).
This commit is contained in:
shanjian%netscape.com 2001-05-17 18:24:27 +00:00
parent f885ab6966
commit 06a97c9df0

View File

@ -66,8 +66,17 @@ class nsMyObserver : public nsICharsetDetectionObserver
private:
nsCOMPtr<nsIWebShellServices> mWebShellSvc;
PRBool mNotifyByReload;
nsCOMPtr<nsIDocument> mWeakRefDocument;
nsCOMPtr<nsIParser> mWeakRefParser;
//The adaptor is owned by parser as filter, and adaptor owns detector,
//which in turn owns observer. Parser also live within the lifespan of
//document. The ownership tree is like:
// document->parser->adaptor->detector->observer
//We do not want to own Document & Parser to avoid ownership loop. That
//will cause memory leakage.
//If in future this chain got changed, ie. parser outlives document, or
//detector outlives parser, we might want to change weak reference here.
nsIDocument* mWeakRefDocument;
nsIParser* mWeakRefParser;
nsAutoString mCharset;
nsCAutoString mCommand;
};