diff --git a/dom/system/gonk/SystemWorkerManager.cpp b/dom/system/gonk/SystemWorkerManager.cpp index 5830dacce456..9d1573702928 100644 --- a/dom/system/gonk/SystemWorkerManager.cpp +++ b/dom/system/gonk/SystemWorkerManager.cpp @@ -129,6 +129,11 @@ SystemWorkerManager::Shutdown() } mWifiWorker = nullptr; + if (mKeyStore) { + mKeyStore->CloseSocket(); + mKeyStore = nullptr; + } + nsCOMPtr obs = mozilla::services::GetObserverService(); if (obs) { obs->RemoveObserver(this, WORKERS_SHUTDOWN_TOPIC); diff --git a/ipc/keystore/KeyStore.cpp b/ipc/keystore/KeyStore.cpp index 460c483be349..c5f01d592d25 100644 --- a/ipc/keystore/KeyStore.cpp +++ b/ipc/keystore/KeyStore.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set sw=4 ts=8 et ft=cpp: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -359,10 +359,16 @@ KeyStoreConnector::GetSocketAddr(const sockaddr_any& aAddr, KeyStore::KeyStore() { + MOZ_COUNT_CTOR(KeyStore); ::startKeyStoreService(); Listen(); } +KeyStore::~KeyStore() +{ + MOZ_COUNT_DTOR(KeyStore); +} + void KeyStore::Shutdown() { diff --git a/ipc/keystore/KeyStore.h b/ipc/keystore/KeyStore.h index a11caddc01db..028e0ff9a6c7 100644 --- a/ipc/keystore/KeyStore.h +++ b/ipc/keystore/KeyStore.h @@ -98,11 +98,12 @@ class KeyStore : public mozilla::ipc::UnixSocketConsumer { public: KeyStore(); - virtual ~KeyStore() {} void Shutdown(); private: + virtual ~KeyStore(); + virtual void ReceiveSocketData(nsAutoPtr& aMessage); virtual void OnConnectSuccess();