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
This commit is contained in:
doshimun 2008-06-09 23:38:24 +00:00
parent 3a516e4177
commit 2d7664e8d4

View File

@ -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() {