summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/window.cxx11
-rw-r--r--vcl/unx/gtk3/gtkframe.cxx10
2 files changed, 16 insertions, 5 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 44f5438e3864..c0a9bf8b141b 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -547,6 +547,9 @@ void Window::dispose()
mpWindowImpl->mpFrameData = nullptr;
}
+ if (mpWindowImpl->mxWindowPeer)
+ mpWindowImpl->mxWindowPeer->dispose();
+
// should be the last statements
mpWindowImpl.reset();
@@ -3104,11 +3107,15 @@ const OUString& Window::GetHelpText() const
void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > const & xPeer, VCLXWindow* pVCLXWindow )
{
- if (!mpWindowImpl)
+ if (!mpWindowImpl || mpWindowImpl->mbInDispose)
return;
// be safe against re-entrance: first clear the old ref, then assign the new one
- mpWindowImpl->mxWindowPeer.clear();
+ if (mpWindowImpl->mxWindowPeer)
+ {
+ mpWindowImpl->mxWindowPeer->dispose();
+ mpWindowImpl->mxWindowPeer.clear();
+ }
mpWindowImpl->mxWindowPeer = xPeer;
mpWindowImpl->mpVCLXWindow = pVCLXWindow;
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index c40a6b75b0e1..10fa515554f4 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -692,6 +692,13 @@ GtkSalFrame::~GtkSalFrame()
while (m_nGrabLevel)
removeGrabLevel();
+ {
+ SolarMutexGuard aGuard;
+
+ if(m_nWatcherId)
+ g_bus_unwatch_name(m_nWatcherId);
+ }
+
GtkWidget *pEventWidget = getMouseEventWidget();
for (auto handler_id : m_aMouseSignalIds)
g_signal_handler_disconnect(G_OBJECT(pEventWidget), handler_id);
@@ -706,9 +713,6 @@ GtkSalFrame::~GtkSalFrame()
{
SolarMutexGuard aGuard;
- if(m_nWatcherId)
- g_bus_unwatch_name(m_nWatcherId);
-
if( m_pWindow )
{
g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", nullptr );