Changeset 1315
- Timestamp:
- 06/29/09 14:37:31 (8 months ago)
- Location:
- trunk/Sources
- Files:
-
- 5 modified
-
BXDatabaseContext.m (modified) (2 diffs)
-
BXLogger.m (modified) (2 diffs)
-
BXPGSQLScriptReader.m (modified) (2 diffs)
-
PGTSConnector.m (modified) (2 diffs)
-
PGTSQuery.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Sources/BXDatabaseContext.m
r1289 r1315 2888 2888 NSMutableArray* retval = nil; 2889 2889 2890 NSMutableData* attributeBuffer = (id) CFRetain ([NSMutableData data]);2890 NSMutableData* attributeBuffer = [NSMutableData data]; 2891 2891 AddKeychainAttributeString (kSecAccountItemAttr, [mDatabaseURI user], attributeBuffer); 2892 2892 AddKeychainAttributeString (kSecServerItemAttr, [mDatabaseURI host], attributeBuffer); … … 2927 2927 2928 2928 //For GC. 2929 CFRelease (attributeBuffer);2929 [attributeBuffer self]; 2930 2930 2931 2931 return retval; -
trunk/Sources/BXLogger.m
r1230 r1315 121 121 const char* file = LastPathComponent (fileName); 122 122 123 NSString* date = (id) CFRetain ([[NSDate date] descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F" timeZone: nil locale: nil]);124 NSString* message = (id) CFRetain ([[[NSString alloc] initWithFormat: messageFmt arguments: args] autorelease]);123 NSString* date = [[NSDate date] descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F" timeZone: nil locale: nil]; 124 NSString* message = [[[NSString alloc] initWithFormat: messageFmt arguments: args] autorelease]; 125 125 126 126 const char isMain = ([NSThread isMainThread] ? 'm' : 's'); … … 129 129 130 130 //For GC. 131 CFRelease (date);132 CFRelease (message);131 [date self]; 132 [message self]; 133 133 134 134 if (executable) -
trunk/Sources/BXPGSQLScriptReader.m
r1188 r1315 67 67 } 68 68 69 NSString* pathString = (id) CFRetain ([fileURL path]);69 NSString* pathString = [fileURL path]; 70 70 const char* path = [pathString UTF8String]; 71 71 int fd = open (path, O_RDONLY | O_SHLOCK); … … 80 80 81 81 //For GC. 82 CFRelease (pathString);82 [pathString self]; 83 83 return retval; 84 84 } -
trunk/Sources/PGTSConnector.m
r1257 r1315 46 46 CopyConnectionString (NSDictionary* connectionDict) 47 47 { 48 //-UTF8String assigns an internal pointer, hence the CFRetain + CFRelease.49 48 NSMutableString* connectionString = [NSMutableString string]; 50 CFRetain (connectionString);51 49 NSEnumerator* e = [connectionDict keyEnumerator]; 52 50 NSString* currentKey; … … 58 56 } 59 57 char* retval = strdup ([connectionString UTF8String]); 60 CFRelease (connectionString); 58 59 //For GC. 60 [connectionString self]; 61 61 return retval; 62 62 } -
trunk/Sources/PGTSQuery.m
r1277 r1315 150 150 { 151 151 NSMutableString* desc = [NSMutableString string]; 152 CFRetain (desc);153 152 for (int i = 0; i < nParams; i++) 154 153 { … … 162 161 } 163 162 char* retval = strdup ([desc UTF8String] ?: ""); 164 CFRelease (desc); 163 164 //For GC. 165 [desc self]; 165 166 return retval; 166 167 } … … 175 176 NSUInteger nParams = [self parameterCount]; 176 177 NSArray* parameterObjects = [[mParameters PGTSCollect] PGTSParameter: connection]; 177 if (parameterObjects) CFRetain (parameterObjects);178 178 179 179 const char** paramValues = calloc (nParams, sizeof (char *)); … … 217 217 [(id) [connection delegate] PGTSConnection: connection sentQuery: self]; 218 218 219 if (parameterObjects) CFRelease (parameterObjects);220 219 free (paramTypes); 221 220 free (paramValues); 222 221 free (paramLengths); 223 222 free (paramFormats); 223 224 //For GC. 225 [parameterObjects self]; 224 226 } 225 227 return retval;
