diff options
-rw-r--r-- | sal/osl/w32/dllentry.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c index f16cab7e773a..dc30f8db7ac7 100644 --- a/sal/osl/w32/dllentry.c +++ b/sal/osl/w32/dllentry.c @@ -261,11 +261,12 @@ static DWORD GetParentProcessId() static DWORD WINAPI ParentMonitorThreadProc( LPVOID lpParam ) { - osl_setThreadName("headless ParentMonitorThread"); - DWORD_PTR dwParentProcessId = (DWORD_PTR)lpParam; HANDLE hParentProcess = OpenProcess( SYNCHRONIZE, FALSE, dwParentProcessId ); + + osl_setThreadName("headless ParentMonitorThread"); + if ( IsValidHandle( hParentProcess ) ) { if ( WAIT_OBJECT_0 == WaitForSingleObject( hParentProcess, INFINITE ) ) |