diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-05 14:21:22 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-02-05 14:10:35 +0100 |
commit | ab99c08defad5431bbd0b456e3854d749ec0173e (patch) | |
tree | f96cb81045f6b66a3fa938d55aed92c34b16e31c /dtrans/source/win32/clipb | |
parent | 3346947b7e102384dfc6cd98dbf7da81936f8fd6 (diff) |
Cleanup event properly; handle error from MsgWaitForMultipleObjects
Commit 11a2809e369b2a6fcbb2d7f0db131a945557c6e2 follow-up
Change-Id: Id70a95f46655ade3b867e0377ddd5bee13993187
Reviewed-on: https://gerrit.libreoffice.org/67402
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dtrans/source/win32/clipb')
-rw-r--r-- | dtrans/source/win32/clipb/MtaOleClipb.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx index ac3dc68083e1..2c579e38e741 100644 --- a/dtrans/source/win32/clipb/MtaOleClipb.cxx +++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx @@ -108,6 +108,9 @@ namespace /* private */ break; } + + default: // WAIT_FAILED? + return false; } } } @@ -268,6 +271,10 @@ CMtaOleClipboard::~CMtaOleClipboard( ) m_bRunClipboardNotifierThread = false; SetEvent( m_hTerminateClipboardChangedNotifierEvent ); + // unblock whoever could still wait for event processing + if (m_hEvtWndDisposed) + SetEvent(m_hEvtWndDisposed); + sal_uInt32 dwResult = WaitForSingleObject( m_hClipboardChangedNotifierThread, MAX_WAIT_SHUTDOWN ); @@ -297,6 +304,9 @@ CMtaOleClipboard::~CMtaOleClipboard( ) if ( nullptr != m_hEvtThrdReady ) CloseHandle( m_hEvtThrdReady ); + if (m_hEvtWndDisposed) + CloseHandle(m_hEvtWndDisposed); + if ( m_MtaOleReqWndClassAtom ) UnregisterClassW( g_szWndClsName, nullptr ); |