Bug 1118535 - Don't let PBackgroundChild actors leak HANDLEs on Windows, r=mrbkap.
☠☠ backed out by b460db55cd53 ☠ ☠
authorBen Turner <bent.mozilla@gmail.com>
Tue, 06 Jan 2015 20:20:27 -0800
changeset 222371 a6a42670bebb26a7d177ee3e44e36dfac1802a59
parent 222370 43d7ef42277746368e6f94b2ff9cf28c7898cd12
child 222372 b1741d5e3b99530bce4b948363b900640f993b49
push id10683
push usercbook@mozilla.com
push dateWed, 07 Jan 2015 13:30:50 +0000
treeherderfx-team@3a1103c584cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1118535
milestone37.0a1
Bug 1118535 - Don't let PBackgroundChild actors leak HANDLEs on Windows, r=mrbkap.
ipc/glue/BackgroundImpl.cpp
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -434,16 +434,21 @@ private:
 
     if (threadLocalInfo) {
       MOZ_ASSERT(threadLocalInfo->mClosed);
 
       if (threadLocalInfo->mActor) {
         threadLocalInfo->mActor->Close();
         threadLocalInfo->mActor->AssertActorDestroyed();
 
+        ProcessHandle otherProcess = threadLocalInfo->mActor->OtherProcess();
+        if (otherProcess != kInvalidProcessHandle) {
+          base::CloseProcessHandle(otherProcess);
+        }
+
         // Since the actor is created on the main thread it must only
         // be released on the main thread as well.
         if (!NS_IsMainThread()) {
           ChildImpl* actor;
           threadLocalInfo->mActor.forget(&actor);
 
           nsCOMPtr<nsIRunnable> releaser =
             NS_NewNonOwningRunnableMethod(actor, &ChildImpl::Release);