Bug 918595 - Assertion: mozilla::ipc::FileDescriptor::CloseCurrentProcessHandle at FileDescriptor.cpp:68 MOZ_ASSERT_IF(mHandleCreatedByOtherProcess draft
authorGregor Wagner <anygregor@gmail.com>
Wed, 07 May 2014 15:57:48 -0700
changeset 388095 9ea0ccf76dea7b7f5158f48957dab80174d4ba02
parent 388094 db39e2d6a49978cf20f58993be6c39681a5d8246
child 388096 eea0439600fad96addf7e0088a20272731376018
push id23132
push userbmo:lissyx+mozillians@lissyx.dyndns.org
push dateFri, 15 Jul 2016 10:07:12 +0000
bugs918595
milestone32.0a1
Bug 918595 - Assertion: mozilla::ipc::FileDescriptor::CloseCurrentProcessHandle at FileDescriptor.cpp:68 MOZ_ASSERT_IF(mHandleCreatedByOtherProcess
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1362,19 +1362,20 @@ TabChild::~TabChild()
 
     for (uint32_t index = 0, count = mCachedFileDescriptorInfos.Length();
          index < count;
          index++) {
         nsAutoPtr<CachedFileDescriptorInfo>& info =
             mCachedFileDescriptorInfos[index];
 
         MOZ_ASSERT(!info->mCallback);
-        MOZ_ASSERT(!info->mCanceled);
 
         if (info->mFileDescriptor.IsValid()) {
+            MOZ_ASSERT(!info->mCanceled);
+
             nsRefPtr<CloseFileRunnable> runnable =
                 new CloseFileRunnable(info->mFileDescriptor);
             runnable->Dispatch();
         }
     }
 }
 
 void
@@ -1574,16 +1575,19 @@ TabChild::CancelCachedFileDescriptorCall
         mCachedFileDescriptorInfos[index];
 
     MOZ_ASSERT(info);
     MOZ_ASSERT(info->mPath == aPath);
     MOZ_ASSERT(!info->mFileDescriptor.IsValid());
     MOZ_ASSERT(info->mCallback == aCallback);
     MOZ_ASSERT(!info->mCanceled);
 
+    // No need to hold the callback any longer.
+    info->mCallback = nullptr;
+    
     // Set this flag so that we will close the file descriptor when it arrives.
     info->mCanceled = true;
 }
 
 void
 TabChild::DoFakeShow()
 {
   RecvShow(nsIntSize(0, 0));