summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-21 12:30:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-21 13:45:00 +0200
commit0820a4c7ac12e6fc2cc683f8a07c99a11d40e30e (patch)
tree54a5ce10d153e9b99b720c5c45454c0c1021267d /sfx2
parentf654af56695197d11c277c424b0dd2b93195add9 (diff)
fix leak in some tests
this situation only really happens during shutdown, when some of the app events are dropped Change-Id: If327daf1be243a603669f624b49917a73ddfd0fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115909 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewsh.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index b10b17853914..ee5bcccec5be 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -202,7 +202,8 @@ void SAL_CALL SfxClipboardChangeListener::disposing( const lang::EventObject& /*
// root for many deadlocks, especially in conjunction with the "Windows"
// based single thread apartment clipboard code!
AsyncExecuteInfo* pInfo = new AsyncExecuteInfo( ASYNCEXECUTE_CMD_DISPOSING, this );
- Application::PostUserEvent( LINK( nullptr, SfxClipboardChangeListener, AsyncExecuteHdl_Impl ), pInfo );
+ if (!Application::PostUserEvent( LINK( nullptr, SfxClipboardChangeListener, AsyncExecuteHdl_Impl ), pInfo ))
+ delete pInfo;
}
void SAL_CALL SfxClipboardChangeListener::changedContents( const datatransfer::clipboard::ClipboardEvent& )
@@ -211,7 +212,8 @@ void SAL_CALL SfxClipboardChangeListener::changedContents( const datatransfer::c
// root for many deadlocks, especially in conjunction with the "Windows"
// based single thread apartment clipboard code!
AsyncExecuteInfo* pInfo = new AsyncExecuteInfo( ASYNCEXECUTE_CMD_CHANGEDCONTENTS, this );
- Application::PostUserEvent( LINK( nullptr, SfxClipboardChangeListener, AsyncExecuteHdl_Impl ), pInfo );
+ if (!Application::PostUserEvent( LINK( nullptr, SfxClipboardChangeListener, AsyncExecuteHdl_Impl ), pInfo ))
+ delete pInfo;
}
sal_uInt32 SfxViewShell_Impl::m_nLastViewShellId = 0;