mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 05:44:10 +00:00
Changed AddObserver() to check if the observer is already in the list.
This worksaround a problem with the pres shell being added twice
This commit is contained in:
parent
2d70af64ed
commit
a89d59bb51
@ -338,7 +338,10 @@ void nsDocument::AddStyleSheet(nsIStyleSheet* aSheet)
|
||||
// that it has a live reference to the document.
|
||||
void nsDocument::AddObserver(nsIDocumentObserver* aObserver)
|
||||
{
|
||||
mObservers.AppendElement(aObserver);
|
||||
// XXX Make sure the observer isn't already in the list
|
||||
if (mObservers.IndexOf(aObserver) == -1) {
|
||||
mObservers.AppendElement(aObserver);
|
||||
}
|
||||
}
|
||||
|
||||
PRBool nsDocument::RemoveObserver(nsIDocumentObserver* aObserver)
|
||||
|
@ -338,7 +338,10 @@ void nsDocument::AddStyleSheet(nsIStyleSheet* aSheet)
|
||||
// that it has a live reference to the document.
|
||||
void nsDocument::AddObserver(nsIDocumentObserver* aObserver)
|
||||
{
|
||||
mObservers.AppendElement(aObserver);
|
||||
// XXX Make sure the observer isn't already in the list
|
||||
if (mObservers.IndexOf(aObserver) == -1) {
|
||||
mObservers.AppendElement(aObserver);
|
||||
}
|
||||
}
|
||||
|
||||
PRBool nsDocument::RemoveObserver(nsIDocumentObserver* aObserver)
|
||||
|
Loading…
x
Reference in New Issue
Block a user