Bug 1121497 - Need to stop location manager before start, r=dougt
authorGarvan Keeley <gkeeley@mozilla.com>
Wed, 14 Jan 2015 20:02:00 +0100
changeset 226211 c6bec2021c057be266ec2f4b96d09e35014167c5
parent 226210 4a90a7ba532ad4a71c9e519a3703b4aaf412fcd0
child 226212 4cf56d1211c9999216cb89c792f3217ce684c88d
push id54787
push usercbook@mozilla.com
push dateWed, 28 Jan 2015 08:22:17 +0000
treeherdermozilla-inbound@c6bec2021c05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs1121497
milestone38.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 1121497 - Need to stop location manager before start, r=dougt
dom/system/mac/CoreLocationLocationProvider.mm
--- a/dom/system/mac/CoreLocationLocationProvider.mm
+++ b/dom/system/mac/CoreLocationLocationProvider.mm
@@ -206,16 +206,18 @@ CoreLocationLocationProvider::Startup()
     nsAutoPtr<CoreLocationObjects> clObjs(new CoreLocationObjects());
 
     nsresult rv = clObjs->Init(this);
     NS_ENSURE_SUCCESS(rv, rv);
 
     mCLObjects = clObjs.forget();
   }
 
+  // Must be stopped before starting or response (success or failure) is not guaranteed
+  [mCLObjects->mLocationManager stopUpdatingLocation];
   [mCLObjects->mLocationManager startUpdatingLocation];
   return NS_OK;
 }
 
 NS_IMETHODIMP
 CoreLocationLocationProvider::Watch(nsIGeolocationUpdate* aCallback)
 {
   if (mCallback) {