You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/05/19 00:11:21 UTC

[7/7] js commit: [CB-462] tweak watch accel to fire success calblack on the appropriate interval, not based on how quickly framework returns info

[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/58a213de
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/58a213de
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/58a213de

Branch: refs/heads/master
Commit: 58a213de4b6597942b17734208617dc680fa9e22
Parents: 2058df7
Author: Fil Maj <ma...@gmail.com>
Authored: Fri May 18 13:43:07 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri May 18 15:14:37 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/58a213de/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] = {