Making sample better by using COMPtr r=waterson

git-svn-id: svn://10.0.0.236/trunk@51415 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dp%netscape.com
1999-10-21 21:32:17 +00:00
parent 480412f60c
commit a87080011d

View File

@@ -58,8 +58,8 @@ CreateNew##_name(nsISupports* aOuter, REFNSIID aIID, void **aResult) \
*aResult = nsnull; \
return NS_ERROR_NO_AGGREGATION; \
} \
nsI##_name* inst; \
nsresult rv = NS_New##_name(&inst); \
nsCOMPtr<nsI##_name> inst; \
nsresult rv = NS_New##_name(getter_AddRefs(inst)); \
if (NS_FAILED(rv)) { \
*aResult = nsnull; \
return rv; \
@@ -68,7 +68,6 @@ CreateNew##_name(nsISupports* aOuter, REFNSIID aIID, void **aResult) \
if (NS_FAILED(rv)) { \
*aResult = nsnull; \
} \
NS_RELEASE(inst); /* get rid of extra refcnt */ \
return rv; \
}