Bug 540967 - "missing output line for total leaks" because the parent process isn't waiting for the child process to clean up/write leak logs, r=cjones

This commit is contained in:
Benjamin Smedberg 2010-01-22 10:21:33 -05:00
Родитель 4870a14160
Коммит 0d419bb10f
3 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -24,7 +24,7 @@ class ProcessWatcher {
// and SYNCHRONIZE permissions.
//
static void EnsureProcessTerminated(base::ProcessHandle process_handle
#if defined(CHROMIUM_MOZILLA_BUILD) && defined(OS_POSIX)
#if defined(CHROMIUM_MOZILLA_BUILD)
, bool force=true
#endif
);

Просмотреть файл

@ -78,9 +78,21 @@ class TimerExpiredTask : public Task, public base::ObjectWatcher::Delegate {
} // namespace
// static
void ProcessWatcher::EnsureProcessTerminated(base::ProcessHandle process) {
void ProcessWatcher::EnsureProcessTerminated(base::ProcessHandle process
#ifdef CHROMIUM_MOZILLA_BUILD
, bool force
#endif
) {
DCHECK(process != GetCurrentProcess());
#ifdef CHROMIUM_MOZILLA_BUILD
if (!force) {
WaitForSingleObject(process, INFINITE);
CloseHandle(process);
return;
}
#endif
// If already signaled, then we are done!
if (WaitForSingleObject(process, 0) == WAIT_OBJECT_0) {
CloseHandle(process);

Просмотреть файл

@ -91,7 +91,7 @@ GeckoChildProcessHost::~GeckoChildProcessHost()
if (mChildProcessHandle > 0)
ProcessWatcher::EnsureProcessTerminated(mChildProcessHandle
#if defined(OS_POSIX) && defined(NS_BUILD_REFCNT_LOGGING)
#if defined(NS_BUILD_REFCNT_LOGGING)
, false // don't "force"
#endif
);