You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/04/07 00:47:50 UTC

ios commit: Clean-up of CDVLocation and fix static analyzer warnings.

Updated Branches:
  refs/heads/master eb4f713ad -> b7bc1a980


Clean-up of CDVLocation and fix static analyzer warnings.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/b7bc1a98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/b7bc1a98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/b7bc1a98

Branch: refs/heads/master
Commit: b7bc1a980aeb91f484903d2b852cf989a07abf72
Parents: eb4f713
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Apr 6 15:47:43 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Apr 6 15:47:43 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVLocation.h |   15 +--------------
 CordovaLib/Classes/CDVLocation.m |    4 ++--
 2 files changed, 3 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/b7bc1a98/CordovaLib/Classes/CDVLocation.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVLocation.h b/CordovaLib/Classes/CDVLocation.h
index d004a21..7f4879a 100755
--- a/CordovaLib/Classes/CDVLocation.h
+++ b/CordovaLib/Classes/CDVLocation.h
@@ -39,19 +39,12 @@ typedef NSUInteger CDVLocationStatus;
 
 // simple object to keep track of heading information
 @interface CDVHeadingData : NSObject {
-    CDVHeadingStatus    headingStatus;
-    CLHeading*          headingInfo;
-    NSMutableArray*     headingCallbacks;
-    NSString*           headingFilter;
-    NSDate*             headingTimestamp;
-    NSInteger           timeout;
-    
 }
 
 @property (nonatomic, assign) CDVHeadingStatus headingStatus;
 @property (nonatomic, retain) CLHeading* headingInfo;
 @property (nonatomic, retain) NSMutableArray* headingCallbacks;
-@property (nonatomic, retain) NSString* headingFilter;
+@property (nonatomic, copy) NSString* headingFilter;
 @property (nonatomic, retain) NSDate* headingTimestamp;
 @property (assign) NSInteger timeout;
 
@@ -59,9 +52,6 @@ typedef NSUInteger CDVLocationStatus;
 
 // simple ojbect to keep track of location information
 @interface CDVLocationData : NSObject {
-    CDVLocationStatus locationStatus;
-    NSMutableArray*  locationCallbacks;
-    CLLocation*      locationInfo;
 }
 
 @property (nonatomic, assign) CDVLocationStatus locationStatus;
@@ -72,9 +62,6 @@ typedef NSUInteger CDVLocationStatus;
 
 @interface CDVLocation : CDVPlugin <CLLocationManagerDelegate> {
     @private BOOL      __locationStarted;
-    CLLocationManager* locationManager;
-    CDVHeadingData*    headingData;
-    CDVLocationData*   locationData;
 }
 
 @property (nonatomic, retain) CLLocationManager *locationManager;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/b7bc1a98/CordovaLib/Classes/CDVLocation.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVLocation.m b/CordovaLib/Classes/CDVLocation.m
index 269fb2c..1d946bb 100755
--- a/CordovaLib/Classes/CDVLocation.m
+++ b/CordovaLib/Classes/CDVLocation.m
@@ -364,7 +364,7 @@
     } else {
         // heading retrieval does is not affected by disabling locationServices and authorization of app for location services
         if (!self.headingData) {
-            self.headingData = [[CDVHeadingData alloc] init];
+            self.headingData = [[[CDVHeadingData alloc] init] autorelease];
         }
         CDVHeadingData* hData = self.headingData;
 
@@ -396,7 +396,7 @@
         [super writeJavascript:[result toErrorCallbackString:callbackId]];
     } else {
         if (!hData) {
-            self.headingData = [[CDVHeadingData alloc] init] ;
+            self.headingData = [[[CDVHeadingData alloc] init] autorelease];
             hData = self.headingData;
         }
         if (hData.headingStatus != HEADINGRUNNING) {