Bug 1020046 - Apply Bug 1011110 to bluetooth2, r=shuang
authorBen Tian <btian@mozilla.com>
Wed, 04 Jun 2014 10:03:14 +0800
changeset 186533 5d411b835731b3d3178a4c9799e8457793c29eb2
parent 186532 c996f5dee5e088e313442c67c8e43825e915e3c8
child 186534 793139e547c7ec5f5ee8118f053fb30c853eebb8
push idunknown
push userunknown
push dateunknown
reviewersshuang
bugs1020046, 1011110
milestone32.0a1
Bug 1020046 - Apply Bug 1011110 to bluetooth2, r=shuang
dom/bluetooth2/ipc/BluetoothParent.cpp
--- a/dom/bluetooth2/ipc/BluetoothParent.cpp
+++ b/dom/bluetooth2/ipc/BluetoothParent.cpp
@@ -19,17 +19,17 @@
 
 using mozilla::unused;
 USING_BLUETOOTH_NAMESPACE
 
 /*******************************************************************************
  * BluetoothRequestParent::ReplyRunnable
  ******************************************************************************/
 
-class BluetoothRequestParent::ReplyRunnable : public BluetoothReplyRunnable
+class BluetoothRequestParent::ReplyRunnable MOZ_FINAL : public BluetoothReplyRunnable
 {
   BluetoothRequestParent* mRequest;
 
 public:
   ReplyRunnable(BluetoothRequestParent* aRequest)
   : BluetoothReplyRunnable(nullptr), mRequest(aRequest)
   {
     MOZ_ASSERT(NS_IsMainThread());
@@ -54,25 +54,32 @@ public:
 
     ReleaseMembers();
     return NS_OK;
   }
 
   void
   Revoke()
   {
-    MOZ_ASSERT(NS_IsMainThread());
-    mRequest = nullptr;
+    ReleaseMembers();
   }
 
   virtual bool
   ParseSuccessfulReply(JS::MutableHandle<JS::Value> aValue) MOZ_OVERRIDE
   {
     MOZ_CRASH("This should never be called!");
   }
+
+  virtual void
+  ReleaseMembers() MOZ_OVERRIDE
+  {
+    MOZ_ASSERT(NS_IsMainThread());
+    mRequest = nullptr;
+    BluetoothReplyRunnable::ReleaseMembers();
+  }
 };
 
 /*******************************************************************************
  * BluetoothParent
  ******************************************************************************/
 
 BluetoothParent::BluetoothParent()
 : mShutdownState(Running)