summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/a11y/atkeditabletext.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2016-11-21 23:01:31 -0500
committerKohei Yoshida <libreoffice@kohei.us>2016-11-22 13:17:40 +0000
commita0ef7474521413c8967559a635e6fdc0d88f1df6 (patch)
tree4d60cec609d6d1c79319702b89f0a004e337dd7c /vcl/unx/gtk/a11y/atkeditabletext.cxx
parente010834dc1a82fcb80dc23025001a752a0fb60a4 (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/atkeditabletext.cxx')
-rw-r--r--vcl/unx/gtk/a11y/atkeditabletext.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/unx/gtk/a11y/atkeditabletext.cxx b/vcl/unx/gtk/a11y/atkeditabletext.cxx
index f601f137dd04..ee984bdeb7b6 100644
--- a/vcl/unx/gtk/a11y/atkeditabletext.cxx
+++ b/vcl/unx/gtk/a11y/atkeditabletext.cxx
@@ -31,14 +31,11 @@ static css::uno::Reference<css::accessibility::XAccessibleEditableText>
getEditableText( AtkEditableText *pEditableText ) throw (uno::RuntimeException)
{
AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pEditableText );
- if( pWrap )
+ if (pWrap)
{
- if( !pWrap->mpEditableText.is() )
- {
- pWrap->mpEditableText.set(pWrap->mpContext, css::uno::UNO_QUERY);
- }
-
- return pWrap->mpEditableText;
+ uno::Reference<accessibility::XAccessibleEditableText> xET(
+ pWrap->mpContext.get(), uno::UNO_QUERY);
+ return xET;
}
return css::uno::Reference<css::accessibility::XAccessibleEditableText>();