summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolkit/source/awt/vclxwindow.cxx12
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;
}