toolkit/source/awt/vclxwindow.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
New commits: commit f23bc008aefe7d5ab2da8a283fe899798d15a2fa Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu May 13 18:45:18 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu May 13 20:22:25 2021 +0200 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.gran...@collabora.co.uk> 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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits