An assert was being hit because WaitableEvent's dtor was calling CloseHandle on a handle that we already closed.
BUG=8070 Review URL: http://codereview.chromium.org/40195 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11078 0039d316-1c4b-4281-b951-d872f2087c98
Esse commit está contido em:
@@ -56,6 +56,9 @@ class WaitableEvent {
|
||||
// created. This objects takes ownership of the HANDLE and will close it when
|
||||
// deleted.
|
||||
explicit WaitableEvent(HANDLE event_handle);
|
||||
|
||||
// Releases ownership of the handle from this object.
|
||||
HANDLE Release();
|
||||
#endif
|
||||
|
||||
// WARNING: Destroying a WaitableEvent while threads are waiting on it is not
|
||||
|
||||
@@ -28,6 +28,12 @@ WaitableEvent::~WaitableEvent() {
|
||||
CloseHandle(handle_);
|
||||
}
|
||||
|
||||
HANDLE WaitableEvent::Release() {
|
||||
HANDLE rv = handle_;
|
||||
handle_ = INVALID_HANDLE_VALUE;
|
||||
return rv;
|
||||
}
|
||||
|
||||
void WaitableEvent::Reset() {
|
||||
ResetEvent(handle_);
|
||||
}
|
||||
|
||||
@@ -55,6 +55,10 @@ ChildProcessHost::~ChildProcessHost() {
|
||||
if (handle()) {
|
||||
watcher_.StopWatching();
|
||||
ProcessWatcher::EnsureProcessTerminated(handle());
|
||||
|
||||
// Above call took ownership, so don't want WaitableEvent to assert because
|
||||
// the handle isn't valid anymore.
|
||||
process_event_->Release();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário