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 164824 061dae9890420af6c6b05ff8e6e43814576cf418
parent 164823 c92ba82eb05488e212b9fdc1da75d1a990315c29
child 164825 0b217de0115b4e8fdcc1cc1e86008d08e94db9b9
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [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);