Updated Branches: refs/heads/462 0463f1b4d -> 4a4ba9985
[CB-462] tweak watch accel to fire success calblack on the appropriate interval, not based on how quickly framework returns info Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/4a4ba998 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/4a4ba998 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/4a4ba998 Branch: refs/heads/462 Commit: 4a4ba9985c920850fe3f229abc60de984e196ab5 Parents: 47d1ee7 Author: Fil Maj <maj....@gmail.com> Authored: Fri May 18 13:43:07 2012 -0700 Committer: Fil Maj <maj....@gmail.com> Committed: Fri May 18 13:43:07 2012 -0700 ---------------------------------------------------------------------- lib/common/plugin/accelerometer.js | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/4a4ba998/lib/common/plugin/accelerometer.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/accelerometer.js b/lib/common/plugin/accelerometer.js index f81b54f..f343902 100644 --- a/lib/common/plugin/accelerometer.js +++ b/lib/common/plugin/accelerometer.js @@ -109,7 +109,10 @@ var accelerometer = { // Keep reference to watch id, and report accel readings as often as defined in frequency var id = utils.createUUID(); - var p = createCallbackPair(successCallback, errorCallback); + var p = createCallbackPair(function(){}, function(e) { + errorCallback(e); + removeListeners(p); + }); listeners.push(p); timers[id] = {