diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2016-11-21 23:01:31 -0500 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2016-11-22 13:17:40 +0000 |
commit | a0ef7474521413c8967559a635e6fdc0d88f1df6 (patch) | |
tree | 4d60cec609d6d1c79319702b89f0a004e337dd7c /vcl/unx/gtk/a11y/atkhypertext.cxx | |
parent | e010834dc1a82fcb80dc23025001a752a0fb60a4 (diff) |
tdf#71409: Use weak reference to avoid potential circular references.
AtkListener shouldn't be holding a reference back to the context /
broadcaster it listens to, as the latter also holds a reference to
the former.
Change-Id: Ie75cc4667f614752db710c20acbb83b93783654f
Reviewed-on: https://gerrit.libreoffice.org/31063
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'vcl/unx/gtk/a11y/atkhypertext.cxx')
-rw-r--r-- | vcl/unx/gtk/a11y/atkhypertext.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/unx/gtk/a11y/atkhypertext.cxx b/vcl/unx/gtk/a11y/atkhypertext.cxx index ff952558d50d..4c28babf9ee2 100644 --- a/vcl/unx/gtk/a11y/atkhypertext.cxx +++ b/vcl/unx/gtk/a11y/atkhypertext.cxx @@ -193,14 +193,11 @@ static css::uno::Reference<css::accessibility::XAccessibleHypertext> getHypertext( AtkHypertext *pHypertext ) throw (uno::RuntimeException) { AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pHypertext ); - if( pWrap ) + if (pWrap) { - if( !pWrap->mpHypertext.is() ) - { - pWrap->mpHypertext.set(pWrap->mpContext, css::uno::UNO_QUERY); - } - - return pWrap->mpHypertext; + uno::Reference<accessibility::XAccessibleHypertext> xAH( + pWrap->mpContext.get(), uno::UNO_QUERY); + return xAH; } return css::uno::Reference<css::accessibility::XAccessibleHypertext>(); |