Bug 1158404 - part 1 - DataChannelShutdown should instead observe xpcom-will-shutdown. r=jesup
authorAndrew McCreight <continuation@gmail.com>
Tue, 20 Oct 2015 10:47:00 +0200
changeset 303908 12a6564962d71fd3544c768e5fcb7439ad53d284
parent 303907 2e52638cab7c5162aea16066d0942776c0b4d7d5
child 303909 ca1313dd74111b6130163c348f06a0469c4d02eb
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1158404
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1158404 - part 1 - DataChannelShutdown should instead observe xpcom-will-shutdown. r=jesup profile-change-net-teardown does not happen in the child process, so this ends up leaking.
netwerk/sctp/datachannel/DataChannel.cpp
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -99,47 +99,47 @@ public:
   void Init()
     {
       nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
       if (!observerService)
         return;
 
       nsresult rv = observerService->AddObserver(this,
-                                                 "profile-change-net-teardown",
+                                                 "xpcom-will-shutdown",
                                                  false);
       MOZ_ASSERT(rv == NS_OK);
       (void) rv;
     }
 
 private:
   virtual ~DataChannelShutdown()
     {
       nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
       if (observerService)
-        observerService->RemoveObserver(this, "profile-change-net-teardown");
+        observerService->RemoveObserver(this, "xpcom-will-shutdown");
     }
 
 public:
   NS_IMETHODIMP Observe(nsISupports* aSubject, const char* aTopic,
                         const char16_t* aData) override {
-    if (strcmp(aTopic, "profile-change-net-teardown") == 0) {
+    if (strcmp(aTopic, "xpcom-will-shutdown") == 0) {
       LOG(("Shutting down SCTP"));
       if (sctp_initialized) {
         usrsctp_finish();
         sctp_initialized = false;
       }
       nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
       if (!observerService)
         return NS_ERROR_FAILURE;
 
       nsresult rv = observerService->RemoveObserver(this,
-                                                    "profile-change-net-teardown");
+                                                    "xpcom-will-shutdown");
       MOZ_ASSERT(rv == NS_OK);
       (void) rv;
 
       RefPtr<DataChannelShutdown> kungFuDeathGrip(this);
       gDataChannelShutdown = nullptr;
     }
     return NS_OK;
   }