fix memory leak of nsIURI in Set and GetAttribute r=waterson

This commit is contained in:
bienvenu%netscape.com 1999-10-15 02:59:37 +00:00
Родитель 66a52807fc
Коммит cca5e191f9
3 изменённых файлов: 12 добавлений и 12 удалений

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

@ -2296,9 +2296,9 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
// know about the StyleRule change. // know about the StyleRule change.
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) { if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURI* docURL = nsnull; nsCOMPtr <nsIURI> docURL;
if (nsnull != mDocument) { if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL); mDocument->GetBaseURL(*getter_AddRefs(docURL));
} }
mAttributes->UpdateStyleRule(docURL, aValue); mAttributes->UpdateStyleRule(docURL, aValue);
@ -2574,9 +2574,9 @@ RDFElementImpl::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNot
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) { if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURI* docURL = nsnull; nsCOMPtr <nsIURI> docURL;
if (nsnull != mDocument) { if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL); mDocument->GetBaseURL(*getter_AddRefs(docURL));
} }
mAttributes->UpdateStyleRule(docURL, ""); mAttributes->UpdateStyleRule(docURL, "");

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

@ -2296,9 +2296,9 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
// know about the StyleRule change. // know about the StyleRule change.
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) { if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURI* docURL = nsnull; nsCOMPtr <nsIURI> docURL;
if (nsnull != mDocument) { if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL); mDocument->GetBaseURL(*getter_AddRefs(docURL));
} }
mAttributes->UpdateStyleRule(docURL, aValue); mAttributes->UpdateStyleRule(docURL, aValue);
@ -2574,9 +2574,9 @@ RDFElementImpl::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNot
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) { if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURI* docURL = nsnull; nsCOMPtr <nsIURI> docURL;
if (nsnull != mDocument) { if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL); mDocument->GetBaseURL(*getter_AddRefs(docURL));
} }
mAttributes->UpdateStyleRule(docURL, ""); mAttributes->UpdateStyleRule(docURL, "");

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

@ -2296,9 +2296,9 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
// know about the StyleRule change. // know about the StyleRule change.
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) { if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURI* docURL = nsnull; nsCOMPtr <nsIURI> docURL;
if (nsnull != mDocument) { if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL); mDocument->GetBaseURL(*getter_AddRefs(docURL));
} }
mAttributes->UpdateStyleRule(docURL, aValue); mAttributes->UpdateStyleRule(docURL, aValue);
@ -2574,9 +2574,9 @@ RDFElementImpl::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNot
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) { if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURI* docURL = nsnull; nsCOMPtr <nsIURI> docURL;
if (nsnull != mDocument) { if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL); mDocument->GetBaseURL(*getter_AddRefs(docURL));
} }
mAttributes->UpdateStyleRule(docURL, ""); mAttributes->UpdateStyleRule(docURL, "");