mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
#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:
parent
f885ab6966
commit
06a97c9df0
@ -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;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user