mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
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:
parent
8dd52cec3d
commit
e3abebb2cc
@ -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);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user