From 2d7664e8d477816e0641e822752f63982c1be74f Mon Sep 17 00:00:00 2001 From: doshimun Date: Mon, 9 Jun 2008 23:38:24 +0000 Subject: In the destructor of ClientInfo, currently the wait on the clent_crashed_event is unregistered after the handle is closed. MSDN clearly says that the behavior is undefined in this case. See http://msdn.microsoft.com/en-us/library/ms685061(VS.85).aspx This change contains the fix for that bug. See attched diff. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@281 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/windows/crash_generation/client_info.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/client/windows/crash_generation/client_info.cc') diff --git a/src/client/windows/crash_generation/client_info.cc b/src/client/windows/crash_generation/client_info.cc index acb966c1..4752c4ae 100644 --- a/src/client/windows/crash_generation/client_info.cc +++ b/src/client/windows/crash_generation/client_info.cc @@ -78,6 +78,16 @@ bool ClientInfo::Initialize() { } ClientInfo::~ClientInfo() { + if (dump_request_wait_handle_) { + // Wait for callbacks that might already be running to finish. + UnregisterWaitEx(dump_request_wait_handle_, INVALID_HANDLE_VALUE); + } + + if (process_exit_wait_handle_) { + // Wait for the callback that might already be running to finish. + UnregisterWaitEx(process_exit_wait_handle_, INVALID_HANDLE_VALUE); + } + if (process_handle_) { CloseHandle(process_handle_); } @@ -89,16 +99,6 @@ ClientInfo::~ClientInfo() { if (dump_generated_handle_) { CloseHandle(dump_generated_handle_); } - - if (dump_request_wait_handle_) { - // Wait for callbacks that might already be running to finish. - UnregisterWaitEx(dump_request_wait_handle_, INVALID_HANDLE_VALUE); - } - - if (process_exit_wait_handle_) { - // Wait for the callback that might already be running to finish. - UnregisterWaitEx(process_exit_wait_handle_, INVALID_HANDLE_VALUE); - } } bool ClientInfo::UnregisterWaits() { -- cgit v1.2.1