diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 954f205a3ab..06c9a96ff8b 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -1532,6 +1532,8 @@ TabChild::DestroyWindow() runnable->Dispatch(); } } + + mCachedFileDescriptorInfos.Clear(); } void diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index d305a171779..a311f9a080f 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -149,7 +149,12 @@ private: FileDescriptor::PlatformHandleType handle = FileDescriptor::PlatformHandleType(PR_FileDesc2NativeHandle(mFD)); - mozilla::unused << tabParent->SendCacheFileDescriptor(mPath, FileDescriptor(handle)); + // Our TabParent may have been destroyed already. If so, don't send any + // fds over, just go back to the IO thread and close them. + if (!tabParent->IsDestroyed()) { + mozilla::unused << tabParent->SendCacheFileDescriptor(mPath, + FileDescriptor(handle)); + } nsCOMPtr eventTarget; mEventTarget.swap(eventTarget);