mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 414482. Don't leak by double-addreffing in CEnumFormatEtc::Clone. Also, fix nsDataObj refcnt logging so we don't appear to be leaking those. r=jmathies,sr=jonas
This commit is contained in:
parent
f612b67c34
commit
614b93d61c
@ -293,6 +293,7 @@ STDMETHODIMP CEnumFormatEtc::Reset(void)
|
||||
*
|
||||
* Purpose:
|
||||
* Returns another IEnumFORMATETC with the same state as ourselves.
|
||||
* It is addrefed.
|
||||
*
|
||||
* Parameters:
|
||||
* ppEnum LPENUMFORMATETC * in which to return the
|
||||
|
@ -435,8 +435,9 @@ STDMETHODIMP_(ULONG) nsDataObj::Release()
|
||||
if (0 < g_cRef)
|
||||
--g_cRef;
|
||||
|
||||
--m_cRef;
|
||||
NS_LOG_RELEASE(this, m_cRef, "nsDataObj");
|
||||
if (0 != --m_cRef)
|
||||
if (0 != m_cRef)
|
||||
return m_cRef;
|
||||
|
||||
delete this;
|
||||
@ -754,16 +755,11 @@ STDMETHODIMP nsDataObj::EnumFormatEtc(DWORD dwDir, LPENUMFORMATETC *ppEnum)
|
||||
break;
|
||||
} // switch
|
||||
|
||||
// Since a new one has been created,
|
||||
// we will ref count the new clone here
|
||||
// before giving it back
|
||||
if (NULL == *ppEnum)
|
||||
return ResultFromScode(E_FAIL);
|
||||
else
|
||||
(*ppEnum)->AddRef();
|
||||
|
||||
// Clone already AddRefed the result so don't addref it again.
|
||||
return NOERROR;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user