From 745338592387420fbac9267a25f25b427351bd47 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 4 Jan 2015 00:54:38 -0500 Subject: [PATCH] Forgot to call AddRef() in QueryInterface(). Thanks to Jonathan Potter. --- wintable/new/accessibility.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wintable/new/accessibility.h b/wintable/new/accessibility.h index 1d77f61..42c5c06 100644 --- a/wintable/new/accessibility.h +++ b/wintable/new/accessibility.h @@ -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)