From 0f2e01677cd0e8857faec99c61d71e88eee78b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 25 Sep 2018 23:05:18 +0100 Subject: [PATCH] dispose custom widget a11y on teardown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iea80ffff0b36e093e4b8e513e924a21da67cb2ce Reviewed-on: https://gerrit.libreoffice.org/61009 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/unx/gtk3/gtk3gtkinst.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 0f64c2edad45..2ada31149d6f 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1911,7 +1911,8 @@ public: virtual void set_busy_cursor(bool bBusy) override { - gtk_widget_realize(m_pWidget); + if (!gtk_widget_get_realized(m_pWidget)) + gtk_widget_realize(m_pWidget); GdkDisplay *pDisplay = gtk_widget_get_display(m_pWidget); GdkCursor *pCursor = bBusy ? gdk_cursor_new_from_name(pDisplay, "progress") : nullptr; gdk_window_set_cursor(gtk_widget_get_window(m_pWidget), pCursor); @@ -4582,6 +4583,9 @@ public: g_object_steal_data(G_OBJECT(m_pDrawingArea), "g-lo-GtkInstanceDrawingArea"); if (m_pAccessible) g_object_unref(m_pAccessible); + css::uno::Reference xComp(m_xAccessible, css::uno::UNO_QUERY); + if (xComp.is()) + xComp->dispose(); g_signal_handler_disconnect(m_pDrawingArea, m_nPopupMenu); g_signal_handler_disconnect(m_pDrawingArea, m_nQueryTooltip); g_signal_handler_disconnect(m_pDrawingArea, m_nStyleUpdatedSignalId);