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