Fix manky nsCOMPtr asserts.

This commit is contained in:
waterson%netscape.com 1999-11-02 02:02:27 +00:00
parent 0cfe671193
commit 22be6e4c41
2 changed files with 10 additions and 6 deletions

View File

@ -4154,8 +4154,9 @@ nsXULDocument::PrepareToWalk()
PRUint32 count;
overlays->Count(&count);
for (PRInt32 i = count - 1; i >= 0; --i) {
nsCOMPtr<nsISupports> isupports = dont_AddRef(overlays->ElementAt(i));
nsISupports* isupports = overlays->ElementAt(i);
mUnloadedOverlays->AppendElement(isupports);
NS_IF_RELEASE(isupports);
}
@ -5007,9 +5008,10 @@ nsXULDocument::AddPrototypeSheets()
PRUint32 count;
sheets->Count(&count);
for (PRUint32 i = 0; i < count; ++i) {
nsCOMPtr<nsISupports> isupports = dont_AddRef(sheets->ElementAt(i));
nsISupports* isupports = sheets->ElementAt(i);
nsCOMPtr<nsIURI> uri = do_QueryInterface(isupports);
NS_IF_RELEASE(isupports);
NS_ASSERTION(uri != nsnull, "not a URI!!!");
if (! uri)
return NS_ERROR_UNEXPECTED;

View File

@ -4154,8 +4154,9 @@ nsXULDocument::PrepareToWalk()
PRUint32 count;
overlays->Count(&count);
for (PRInt32 i = count - 1; i >= 0; --i) {
nsCOMPtr<nsISupports> isupports = dont_AddRef(overlays->ElementAt(i));
nsISupports* isupports = overlays->ElementAt(i);
mUnloadedOverlays->AppendElement(isupports);
NS_IF_RELEASE(isupports);
}
@ -5007,9 +5008,10 @@ nsXULDocument::AddPrototypeSheets()
PRUint32 count;
sheets->Count(&count);
for (PRUint32 i = 0; i < count; ++i) {
nsCOMPtr<nsISupports> isupports = dont_AddRef(sheets->ElementAt(i));
nsISupports* isupports = sheets->ElementAt(i);
nsCOMPtr<nsIURI> uri = do_QueryInterface(isupports);
NS_IF_RELEASE(isupports);
NS_ASSERTION(uri != nsnull, "not a URI!!!");
if (! uri)
return NS_ERROR_UNEXPECTED;