Bug 488862 - Fix for [@ nsGeolocation::OwnerStillExists() ] crash. r/sr=jst
authorDoug Turner <dougt@meer.net>
Fri, 17 Apr 2009 13:42:04 -0700
changeset 27439 5fef9d3e30c5606a5d8cc22c00f177e16596cdc1
parent 27438 4aed53dcf6921d884e39ec73cde399ce14a5583b
child 27440 b1ebab2896c1107d9d1b6fde9a5fb3679e7a670a
push id6560
push userdougt@mozilla.com
push dateFri, 17 Apr 2009 20:42:16 +0000
treeherdermozilla-central@5fef9d3e30c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs488862
milestone1.9.2a1pre
Bug 488862 - Fix for [@ nsGeolocation::OwnerStillExists() ] crash. r/sr=jst
dom/src/geolocation/nsGeolocation.cpp
--- a/dom/src/geolocation/nsGeolocation.cpp
+++ b/dom/src/geolocation/nsGeolocation.cpp
@@ -572,16 +572,18 @@ nsGeolocation::nsGeolocation(nsIDOMWindo
 
   mService = nsGeolocationService::GetInstance();
   if (mService)
     mService->AddLocator(this);
 }
 
 nsGeolocation::~nsGeolocation()
 {
+  if (mService)
+    Shutdown();
 }
 
 void
 nsGeolocation::Shutdown()
 {
   // Shutdown and release all callbacks
   for (PRUint32 i = 0; i< mPendingCallbacks.Length(); i++)
     mPendingCallbacks[i]->Shutdown();