summaryrefslogtreecommitdiff
path: root/winaccessibility
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-03-07 10:35:38 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2023-03-08 08:57:27 +0000
commitf7ae8fb0c612988a308b16284ce659e860e7ad99 (patch)
tree84a8ce75229ca4658a6ce56d40b465123bb58b26 /winaccessibility
parent2dba67b95227cfe25258ee4b3eebebc24058600c (diff)
tdf#154039 wina11y: Increase refcount for returned COM interface
The reference counter for the IUnknown interface of the COM object needs to be increased in `CMAccessible::get_accSelection` as well, not just in the called `CEnumVariant::Next`, because calling VariantClear` on the temporary variant afterwards decreases the ref count again. Regression from commit 00c0ee8cf0fac0c933c5ae600e99a64b1c7d4397 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Mon Jan 31 07:41:14 2022 +0000 tdf#147083 wina11y: Return a11y object instead of child ID Change-Id: Id968c3d80b38961b836fbb1a9bd6dfeefdff813f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148393 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 38e2dde00da0207c5f7157bb427a006d32dfeb5b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148399 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'winaccessibility')
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index cf53ec077973..7579d7ee1271 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -848,6 +848,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accSelection(VARIANT *pvarCh
return S_FALSE;
pvarChildren->vt = VT_DISPATCH;
pvarChildren->pdispVal = varTmp[0].pdispVal;
+ pvarChildren->pdispVal->AddRef();
VariantClear(&varTmp[0]);
m_pEnumVar->Reset();
break;