Skip to content

Commit

Permalink
Bug 1013748 - Use StaticRefPtr to hold BluetoothService objects, f=sh…
Browse files Browse the repository at this point in the history
…uang, r=tzimmermann, r=khuey
  • Loading branch information
eric30 committed Aug 25, 2014
1 parent d0c5f56 commit 0c8483a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dom/bluetooth/ipc/BluetoothChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "BluetoothChild.h"

#include "mozilla/Assertions.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
#include "nsDebug.h"
#include "nsISupportsImpl.h"
#include "nsThreadUtils.h"
Expand All @@ -17,11 +19,12 @@
#include "BluetoothService.h"
#include "BluetoothServiceChildProcess.h"

using namespace mozilla;
USING_BLUETOOTH_NAMESPACE

namespace {

BluetoothServiceChildProcess* sBluetoothService;
StaticRefPtr<BluetoothServiceChildProcess> sBluetoothService;

} // anonymous namespace

Expand All @@ -37,6 +40,7 @@ BluetoothChild::BluetoothChild(BluetoothServiceChildProcess* aBluetoothService)
MOZ_ASSERT(aBluetoothService);

sBluetoothService = aBluetoothService;
ClearOnShutdown(&sBluetoothService);
}

BluetoothChild::~BluetoothChild()
Expand Down

0 comments on commit 0c8483a

Please sign in to comment.