Forgot to call AddRef() in QueryInterface(). Thanks to Jonathan Potter.

This commit is contained in:
Pietro Gagliardi 2015-01-04 00:54:38 -05:00
parent 7487dbb27c
commit 7453385923
1 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,8 @@ struct tableAcc {
// TODO create a standard accessible object
};
#define TA ((struct tableAcc *) this)
static HRESULT STDMETHODCALLTYPE tableAccQueryInterface(IAccessible *this, REFIID riid, void **ppvObject)
{
if (ppvObject == NULL)
@ -14,6 +16,7 @@ static HRESULT STDMETHODCALLTYPE tableAccQueryInterface(IAccessible *this, REFII
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IDispatch) ||
IsEqualIID(riid, &IID_IAccessible)) {
TA->vtbl->AddRef(TA);
*ppvObject = (void *) this;
return S_OK;
}
@ -21,8 +24,6 @@ static HRESULT STDMETHODCALLTYPE tableAccQueryInterface(IAccessible *this, REFII
return E_NOINTERFACE;
}
#define TA ((struct tableAcc *) this)
// TODO use InterlockedIncrement()/InterlockedDecrement() for these?
static ULONG STDMETHODCALLTYPE tableAccAddRef(IAccessible *this)