Bug 927201 - Add null check before trying to close observer service. r=mrbkap
authorGregor Wagner <anygregor@gmail.com>
Wed, 16 Oct 2013 08:12:16 -0400
changeset 165776 061dae9890420af6c6b05ff8e6e43814576cf418
parent 165775 c92ba82eb05488e212b9fdc1da75d1a990315c29
child 165777 0b217de0115b4e8fdcc1cc1e86008d08e94db9b9
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs927201
milestone27.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 927201 - Add null check before trying to close observer service. r=mrbkap
dom/camera/DOMCameraManager.cpp
--- a/dom/camera/DOMCameraManager.cpp
+++ b/dom/camera/DOMCameraManager.cpp
@@ -61,17 +61,19 @@ nsDOMCameraManager::nsDOMCameraManager(n
   SetIsDOMBinding();
 }
 
 nsDOMCameraManager::~nsDOMCameraManager()
 {
   /* destructor code */
   DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
-  obs->RemoveObserver(this, "xpcom-shutdown");
+  if (obs) {
+    obs->RemoveObserver(this, "xpcom-shutdown");
+  }
 }
 
 bool
 nsDOMCameraManager::CheckPermission(nsPIDOMWindow* aWindow)
 {
   nsCOMPtr<nsIPermissionManager> permMgr =
     do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
   NS_ENSURE_TRUE(permMgr, false);