Remove delete call on an interface pointer (nsIFactory), use a nsCOMPtr in stead for proper refcounting. r=troy@netscape.com

This commit is contained in:
jst%citec.fi 2000-01-28 15:16:54 +00:00
parent 8dd52cec3d
commit e3abebb2cc

View File

@ -282,16 +282,12 @@ nsLayoutModule::GetClassObject(nsIComponentManager *aCompMgr,
}
}
nsIFactory* f = new nsLayoutFactory(aClass);
nsCOMPtr<nsIFactory> f = new nsLayoutFactory(aClass);
if (!f) {
return NS_ERROR_OUT_OF_MEMORY;
}
rv = f->QueryInterface(aIID, r_classObj);
if (NS_FAILED(rv)) {
delete f;
}
return rv;
return f->QueryInterface(aIID, r_classObj);
}
//----------------------------------------