mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1163916 (part 1) - Avoid a static nsDebugImpl constructor. r=froydnj.
This commit is contained in:
parent
5142eb7562
commit
742d99332f
@ -579,16 +579,20 @@ Break(const char* aMsg)
|
||||
#endif
|
||||
}
|
||||
|
||||
static const nsDebugImpl kImpl;
|
||||
|
||||
nsresult
|
||||
nsDebugImpl::Create(nsISupports* aOuter, const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
static const nsDebugImpl* sImpl;
|
||||
|
||||
if (NS_WARN_IF(aOuter)) {
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
}
|
||||
|
||||
return const_cast<nsDebugImpl*>(&kImpl)->QueryInterface(aIID, aInstancePtr);
|
||||
if (!sImpl) {
|
||||
sImpl = new nsDebugImpl();
|
||||
}
|
||||
|
||||
return const_cast<nsDebugImpl*>(sImpl)->QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -12,9 +12,7 @@
|
||||
class nsDebugImpl : public nsIDebug2
|
||||
{
|
||||
public:
|
||||
nsDebugImpl()
|
||||
{
|
||||
}
|
||||
nsDebugImpl() = default;
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDEBUG2
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user