Bug 1329682 Gracefully handle immediate ActorDestroy() calls in CacheStreamControlParent. r=asuth a=gchang
authorBen Kelly <ben@wanderview.com>
Wed, 11 Jan 2017 08:35:27 -0800
changeset 353504 0e97ca9a78348eb062b8ea29592a147ba35aa5d6
parent 353503 0ce0e61bac824bdfab2c73726c856bf9f9b764e0
child 353505 4b07f1c2f325a658df284da46377ec1b39e9c28f
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth, gchang
bugs1329682
milestone52.0a2
Bug 1329682 Gracefully handle immediate ActorDestroy() calls in CacheStreamControlParent. r=asuth a=gchang
dom/cache/CacheStreamControlParent.cpp
--- a/dom/cache/CacheStreamControlParent.cpp
+++ b/dom/cache/CacheStreamControlParent.cpp
@@ -79,16 +79,21 @@ CacheStreamControlParent::AssertOwningTh
 }
 #endif
 
 void
 CacheStreamControlParent::ActorDestroy(ActorDestroyReason aReason)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
   CloseAllReadStreamsWithoutReporting();
+  // If the initial SendPStreamControlConstructor() fails we will
+  // be called before mStreamList is set.
+  if (!mStreamList) {
+    return;
+  }
   mStreamList->RemoveStreamControl(this);
   mStreamList->NoteClosedAll();
   mStreamList = nullptr;
 }
 
 bool
 CacheStreamControlParent::RecvNoteClosed(const nsID& aId)
 {