mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1034915 - Don't explicitly call delete on nsExtensibleStringBundle. r=ehsan
This commit is contained in:
parent
1779f79346
commit
f707412721
@ -637,19 +637,16 @@ nsStringBundleService::CreateExtensibleBundle(const char* aCategory,
|
||||
nsIStringBundle** aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = nullptr;
|
||||
|
||||
nsresult res;
|
||||
nsRefPtr<nsExtensibleStringBundle> bundle = new nsExtensibleStringBundle();
|
||||
|
||||
nsExtensibleStringBundle * bundle = new nsExtensibleStringBundle();
|
||||
|
||||
res = bundle->Init(aCategory, this);
|
||||
nsresult res = bundle->Init(aCategory, this);
|
||||
if (NS_FAILED(res)) {
|
||||
delete bundle;
|
||||
return res;
|
||||
}
|
||||
|
||||
res = bundle->QueryInterface(NS_GET_IID(nsIStringBundle), (void**) aResult);
|
||||
if (NS_FAILED(res)) delete bundle;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -53,35 +53,27 @@ public:
|
||||
|
||||
class nsExtensibleStringBundle;
|
||||
|
||||
namespace mozilla {
|
||||
template<>
|
||||
struct HasDangerousPublicDestructor<nsExtensibleStringBundle>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* An extensible implementation of the StringBundle interface.
|
||||
*
|
||||
* @created 28/Dec/1999
|
||||
* @author Catalin Rotaru [CATA]
|
||||
*/
|
||||
class nsExtensibleStringBundle : public nsIStringBundle
|
||||
class nsExtensibleStringBundle MOZ_FINAL : public nsIStringBundle
|
||||
{
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSISTRINGBUNDLE
|
||||
|
||||
nsresult Init(const char * aCategory, nsIStringBundleService *);
|
||||
private:
|
||||
|
||||
nsCOMArray<nsIStringBundle> mBundles;
|
||||
bool mLoaded;
|
||||
|
||||
public:
|
||||
|
||||
nsExtensibleStringBundle();
|
||||
|
||||
private:
|
||||
virtual ~nsExtensibleStringBundle();
|
||||
|
||||
nsCOMArray<nsIStringBundle> mBundles;
|
||||
bool mLoaded;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user