diff --git a/content/base/src/FileIOObject.cpp b/content/base/src/FileIOObject.cpp index 6e38f58934f..a58ffc8ed84 100644 --- a/content/base/src/FileIOObject.cpp +++ b/content/base/src/FileIOObject.cpp @@ -88,12 +88,6 @@ FileIOObject::FileIOObject() mTotal(0), mTransferred(0) {} -FileIOObject::~FileIOObject() -{ - if (mListenerManager) - mListenerManager->Disconnect(); -} - void FileIOObject::StartProgressEventTimer() { diff --git a/content/base/src/FileIOObject.h b/content/base/src/FileIOObject.h index 1a9a50210f0..e00bff4529a 100644 --- a/content/base/src/FileIOObject.h +++ b/content/base/src/FileIOObject.h @@ -63,7 +63,6 @@ class FileIOObject : public nsDOMEventTargetWrapperCache, { public: FileIOObject(); - ~FileIOObject(); NS_DECL_ISUPPORTS_INHERITED diff --git a/content/base/src/nsEventSource.cpp b/content/base/src/nsEventSource.cpp index 2d41c78f5ee..3ac1d84d8ee 100644 --- a/content/base/src/nsEventSource.cpp +++ b/content/base/src/nsEventSource.cpp @@ -97,11 +97,6 @@ nsEventSource::nsEventSource() : nsEventSource::~nsEventSource() { Close(); - - if (mListenerManager) { - mListenerManager->Disconnect(); - mListenerManager = nsnull; - } } //----------------------------------------------------------------------------- diff --git a/content/base/src/nsInProcessTabChildGlobal.cpp b/content/base/src/nsInProcessTabChildGlobal.cpp index 10620e087ac..f4379533424 100644 --- a/content/base/src/nsInProcessTabChildGlobal.cpp +++ b/content/base/src/nsInProcessTabChildGlobal.cpp @@ -120,10 +120,6 @@ nsInProcessTabChildGlobal::nsInProcessTabChildGlobal(nsIDocShell* aShell, nsInProcessTabChildGlobal::~nsInProcessTabChildGlobal() { NS_ASSERTION(!mCx, "Couldn't release JSContext?!?"); - - if (mListenerManager) { - mListenerManager->Disconnect(); - } } nsresult diff --git a/content/base/src/nsWebSocket.cpp b/content/base/src/nsWebSocket.cpp index c161f430021..02a7cf5f670 100644 --- a/content/base/src/nsWebSocket.cpp +++ b/content/base/src/nsWebSocket.cpp @@ -400,10 +400,7 @@ nsWebSocket::nsWebSocket() : mKeepingAlive(false), nsWebSocket::~nsWebSocket() { NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread"); - if (mListenerManager) { - mListenerManager->Disconnect(); - mListenerManager = nsnull; - } + Disconnect(); nsLayoutStatics::Release(); } diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 8e5db40498a..c177986b16d 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -401,13 +401,6 @@ nsXHREventTarget::SetOnloadend(nsIDOMEventListener* aOnLoadend) ///////////////////////////////////////////// -nsXMLHttpRequestUpload::~nsXMLHttpRequestUpload() -{ - if (mListenerManager) { - mListenerManager->Disconnect(); - } -} - DOMCI_DATA(XMLHttpRequestUpload, nsXMLHttpRequestUpload) NS_INTERFACE_MAP_BEGIN(nsXMLHttpRequestUpload) @@ -447,10 +440,6 @@ nsXMLHttpRequest::nsXMLHttpRequest() nsXMLHttpRequest::~nsXMLHttpRequest() { - if (mListenerManager) { - mListenerManager->Disconnect(); - } - if (mState & (XML_HTTP_REQUEST_STOPPED | XML_HTTP_REQUEST_SENT | XML_HTTP_REQUEST_LOADING)) { diff --git a/content/base/src/nsXMLHttpRequest.h b/content/base/src/nsXMLHttpRequest.h index 4b225713e23..33e828021fb 100644 --- a/content/base/src/nsXMLHttpRequest.h +++ b/content/base/src/nsXMLHttpRequest.h @@ -100,7 +100,6 @@ public: mOwner = aOwner; mScriptContext = aScriptContext; } - virtual ~nsXMLHttpRequestUpload(); NS_DECL_ISUPPORTS_INHERITED NS_FORWARD_NSIXMLHTTPREQUESTEVENTTARGET(nsXHREventTarget::) NS_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget::) diff --git a/content/events/src/nsDOMEventTargetHelper.cpp b/content/events/src/nsDOMEventTargetHelper.cpp index 65d0fd52275..144197cc37b 100644 --- a/content/events/src/nsDOMEventTargetHelper.cpp +++ b/content/events/src/nsDOMEventTargetHelper.cpp @@ -90,6 +90,13 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMEventTargetHelper) NS_IMPL_DOMTARGET_DEFAULTS(nsDOMEventTargetHelper); +nsDOMEventTargetHelper::~nsDOMEventTargetHelper() +{ + if (mListenerManager) { + mListenerManager->Disconnect(); + } +} + NS_IMETHODIMP nsDOMEventTargetHelper::RemoveEventListener(const nsAString& aType, nsIDOMEventListener* aListener, diff --git a/content/events/src/nsDOMEventTargetHelper.h b/content/events/src/nsDOMEventTargetHelper.h index c2dd1488e94..f789e056925 100644 --- a/content/events/src/nsDOMEventTargetHelper.h +++ b/content/events/src/nsDOMEventTargetHelper.h @@ -69,7 +69,7 @@ class nsDOMEventTargetHelper : public nsIDOMEventTarget { public: nsDOMEventTargetHelper() {} - virtual ~nsDOMEventTargetHelper() {} + virtual ~nsDOMEventTargetHelper(); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(nsDOMEventTargetHelper) diff --git a/dom/battery/BatteryManager.cpp b/dom/battery/BatteryManager.cpp index 6c2efacc63b..9dfeefdd982 100644 --- a/dom/battery/BatteryManager.cpp +++ b/dom/battery/BatteryManager.cpp @@ -91,13 +91,6 @@ BatteryManager::BatteryManager() { } -BatteryManager::~BatteryManager() -{ - if (mListenerManager) { - mListenerManager->Disconnect(); - } -} - void BatteryManager::Init(nsPIDOMWindow *aWindow, nsIScriptContext* aScriptContext) { diff --git a/dom/battery/BatteryManager.h b/dom/battery/BatteryManager.h index 09092773e53..3b4d27b25a4 100644 --- a/dom/battery/BatteryManager.h +++ b/dom/battery/BatteryManager.h @@ -66,7 +66,6 @@ public: NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetWrapperCache::) BatteryManager(); - virtual ~BatteryManager(); void Init(nsPIDOMWindow *aWindow, nsIScriptContext* aScriptContext); void Shutdown(); diff --git a/dom/indexedDB/IDBDatabase.cpp b/dom/indexedDB/IDBDatabase.cpp index 21117a4b41f..77b0c93c8ea 100644 --- a/dom/indexedDB/IDBDatabase.cpp +++ b/dom/indexedDB/IDBDatabase.cpp @@ -203,10 +203,6 @@ IDBDatabase::~IDBDatabase() mgr->UnregisterDatabase(this); } } - - if (mListenerManager) { - mListenerManager->Disconnect(); - } } void diff --git a/dom/indexedDB/IDBRequest.cpp b/dom/indexedDB/IDBRequest.cpp index 034b760f7b0..d65029a12e7 100644 --- a/dom/indexedDB/IDBRequest.cpp +++ b/dom/indexedDB/IDBRequest.cpp @@ -77,10 +77,6 @@ IDBRequest::~IDBRequest() // false. UnrootResultVal(); } - - if (mListenerManager) { - mListenerManager->Disconnect(); - } } // static diff --git a/dom/indexedDB/IDBTransaction.cpp b/dom/indexedDB/IDBTransaction.cpp index ef583148b2d..5bc778b689a 100644 --- a/dom/indexedDB/IDBTransaction.cpp +++ b/dom/indexedDB/IDBTransaction.cpp @@ -181,10 +181,6 @@ IDBTransaction::~IDBTransaction() NS_ASSERTION(!mConnection, "Should have called CommitOrRollback!"); NS_ASSERTION(!mCreating, "Should have been cleared already!"); NS_ASSERTION(mFiredCompleteOrAbort, "Should have fired event!"); - - if (mListenerManager) { - mListenerManager->Disconnect(); - } } void diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 322b070aa70..ec9e2e0f0ed 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -999,13 +999,6 @@ TabChildGlobal::TabChildGlobal(TabChild* aTabChild) aTabChild->GetJSContext()); } -TabChildGlobal::~TabChildGlobal() -{ - if (mListenerManager) { - mListenerManager->Disconnect(); - } -} - NS_IMPL_CYCLE_COLLECTION_CLASS(TabChildGlobal) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(TabChildGlobal, diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index 379b074d12a..8eeecb2ebb9 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -94,7 +94,6 @@ class TabChildGlobal : public nsDOMEventTargetWrapperCache, { public: TabChildGlobal(TabChild* aTabChild); - ~TabChildGlobal(); NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TabChildGlobal, nsDOMEventTargetWrapperCache) NS_FORWARD_SAFE_NSIFRAMEMESSAGEMANAGER(mMessageManager)