diff --git a/dom/cellbroadcast/src/CellBroadcast.cpp b/dom/cellbroadcast/src/CellBroadcast.cpp index 849fbb07942..7df492eb5d0 100644 --- a/dom/cellbroadcast/src/CellBroadcast.cpp +++ b/dom/cellbroadcast/src/CellBroadcast.cpp @@ -37,6 +37,12 @@ public: MOZ_ASSERT(mCellBroadcast); mCellBroadcast = nullptr; } + +private: + ~Listener() + { + MOZ_ASSERT(!mCellBroadcast); + } }; NS_IMPL_ISUPPORTS(CellBroadcast::Listener, nsICellBroadcastListener) diff --git a/dom/icc/src/IccListener.h b/dom/icc/src/IccListener.h index e050393877e..c152678d3db 100644 --- a/dom/icc/src/IccListener.h +++ b/dom/icc/src/IccListener.h @@ -21,7 +21,6 @@ public: NS_DECL_NSIICCLISTENER IccListener(IccManager* aIccManager, uint32_t aClientId); - ~IccListener(); void Shutdown(); @@ -32,6 +31,9 @@ public: return mIcc; } +private: + ~IccListener(); + private: uint32_t mClientId; // We did not setup 'mIcc' and 'mIccManager' being a participant of cycle diff --git a/dom/icc/src/IccManager.h b/dom/icc/src/IccManager.h index c1a1f445169..8982cb9e057 100644 --- a/dom/icc/src/IccManager.h +++ b/dom/icc/src/IccManager.h @@ -26,7 +26,6 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IccManager, DOMEventTargetHelper) IccManager(nsPIDOMWindow* aWindow); - ~IccManager(); void Shutdown(); @@ -52,6 +51,9 @@ public: virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; +private: + ~IccManager(); + private: nsTArray> mIccListeners; }; diff --git a/dom/mobileconnection/src/DOMMMIError.h b/dom/mobileconnection/src/DOMMMIError.h index ed883f70cbb..e083ebf6250 100644 --- a/dom/mobileconnection/src/DOMMMIError.h +++ b/dom/mobileconnection/src/DOMMMIError.h @@ -43,6 +43,9 @@ public: return mInfo; } +private: + ~DOMMMIError() {} + private: nsString mServiceCode; Nullable mInfo; diff --git a/dom/mobileconnection/src/MobileCellInfo.h b/dom/mobileconnection/src/MobileCellInfo.h index 8a4830b5d4c..052474466c7 100644 --- a/dom/mobileconnection/src/MobileCellInfo.h +++ b/dom/mobileconnection/src/MobileCellInfo.h @@ -78,6 +78,9 @@ public: return mCdmaNetworkId; } +private: + ~MobileCellInfo() {} + private: nsCOMPtr mWindow; int32_t mGsmLocationAreaCode; diff --git a/dom/mobileconnection/src/MobileConnection.cpp b/dom/mobileconnection/src/MobileConnection.cpp index 3babf761ec8..5a0601bf19b 100644 --- a/dom/mobileconnection/src/MobileConnection.cpp +++ b/dom/mobileconnection/src/MobileConnection.cpp @@ -62,6 +62,12 @@ public: MOZ_ASSERT(mMobileConnection); mMobileConnection = nullptr; } + +private: + ~Listener() + { + MOZ_ASSERT(!mMobileConnection); + } }; NS_IMPL_ISUPPORTS(MobileConnection::Listener, nsIMobileConnectionListener) @@ -130,6 +136,11 @@ MobileConnection::Shutdown() } } +MobileConnection::~MobileConnection() +{ + MOZ_ASSERT(!(mProvider || mListener || mVoice || mData)); +} + JSObject* MobileConnection::WrapObject(JSContext* aCx) { diff --git a/dom/mobileconnection/src/MobileConnection.h b/dom/mobileconnection/src/MobileConnection.h index bc306ed9480..14adf7f1187 100644 --- a/dom/mobileconnection/src/MobileConnection.h +++ b/dom/mobileconnection/src/MobileConnection.h @@ -155,6 +155,9 @@ public: IMPL_EVENT_HANDLER(radiostatechange) IMPL_EVENT_HANDLER(clirmodechange) +private: + ~MobileConnection(); + private: uint32_t mClientId; nsCOMPtr mProvider; diff --git a/dom/mobileconnection/src/MobileConnectionInfo.h b/dom/mobileconnection/src/MobileConnectionInfo.h index bee8d53aa16..2437961b76f 100644 --- a/dom/mobileconnection/src/MobileConnectionInfo.h +++ b/dom/mobileconnection/src/MobileConnectionInfo.h @@ -93,6 +93,9 @@ public: return mCellInfo; } +private: + ~MobileConnectionInfo() {} + private: bool mConnected; bool mEmergencyCallsOnly; diff --git a/dom/mobileconnection/src/MobileNetworkInfo.h b/dom/mobileconnection/src/MobileNetworkInfo.h index ff2cb22d414..3c6b408248c 100644 --- a/dom/mobileconnection/src/MobileNetworkInfo.h +++ b/dom/mobileconnection/src/MobileNetworkInfo.h @@ -61,6 +61,9 @@ public: return Nullable(); } +private: + ~MobileNetworkInfo() {} + private: nsCOMPtr mWindow; nsString mShortName; diff --git a/dom/voicemail/Voicemail.cpp b/dom/voicemail/Voicemail.cpp index 5976cce2b66..cf08eca933a 100644 --- a/dom/voicemail/Voicemail.cpp +++ b/dom/voicemail/Voicemail.cpp @@ -39,6 +39,12 @@ public: MOZ_ASSERT(mVoicemail); mVoicemail = nullptr; } + +private: + ~Listener() + { + MOZ_ASSERT(!mVoicemail); + } }; NS_IMPL_ISUPPORTS(Voicemail::Listener, nsIVoicemailListener)