diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-13 18:45:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-13 20:22:25 +0200 |
commit | f23bc008aefe7d5ab2da8a283fe899798d15a2fa (patch) | |
tree | d72485f46edeb585dd6550f381878c014e9e61d9 /toolkit | |
parent | 951c998ea27211f587e363d8aee70963177bdf05 (diff) |
fix leak in VCLXWindowImpl
where the manual acquire() was not matched by a release() if we disposed
while an event was in progress
Change-Id: I307997772ccdfc912a16f0fb233f4e933f95cfbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115566
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index dfc6ba8f7c00..616d93fe834d 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -221,10 +221,14 @@ void VCLXWindowImpl::disposing() { SolarMutexGuard aGuard; if ( mnCallbackEventId ) + { Application::RemoveUserEvent( mnCallbackEventId ); - mnCallbackEventId = nullptr; + mnCallbackEventId = nullptr; + // we acquired our VCLXWindow once before posting the event, release this one ref now + mrAntiImpl.release(); + } - mbDisposed= true; + mbDisposed = true; css::lang::EventObject aEvent; aEvent.Source = mrAntiImpl; @@ -275,9 +279,7 @@ IMPL_LINK_NOARG(VCLXWindowImpl, OnProcessCallbacks, void*, void) // we acquired our VCLXWindow once before posting the event, release this one ref now mrAntiImpl.release(); - if ( !mnCallbackEventId ) - // we were disposed while waiting for the mutex to lock - return; + assert( mnCallbackEventId && "should not be possible to call us if the event was removed"); mnCallbackEventId = nullptr; } |