From a0ef7474521413c8967559a635e6fdc0d88f1df6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 21 Nov 2016 23:01:31 -0500 Subject: 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 Reviewed-by: Kohei Yoshida --- vcl/unx/gtk/a11y/atkeditabletext.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'vcl/unx/gtk/a11y/atkeditabletext.cxx') 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 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 xET( + pWrap->mpContext.get(), uno::UNO_QUERY); + return xET; } return css::uno::Reference(); -- cgit