Update of /cvsroot/pgsqlformac/pgCocoaDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26506 Modified Files: ChangeLog Connection.m Databases.m ExplorerModel.m ExplorerNode.m Field.m Fields.m RecordSet.m Schema.m Table.m Log Message: More memory cleanup. Index: RecordSet.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/RecordSet.m,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RecordSet.m 11 Aug 2006 18:01:26 -0000 1.4 --- RecordSet.m 12 Aug 2006 16:38:16 -0000 1.5 *************** *** 14,20 **** { [super init]; - items = [[NSMutableArray alloc] init]; - [items retain]; return self; --- 14,18 ---- Index: Table.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Table.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Table.m 11 Aug 2006 18:01:26 -0000 1.3 --- Table.m 12 Aug 2006 16:38:16 -0000 1.4 *************** *** 12,15 **** --- 12,22 ---- @implementation Table + -(id)init + { + [super init]; + NSLog(@"Created Table.h"); + return self; + } + -(void)dealloc { Index: ChangeLog =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ChangeLog 11 Aug 2006 18:01:25 -0000 1.13 --- ChangeLog 12 Aug 2006 16:38:16 -0000 1.14 *************** *** 1,2 **** --- 1,9 ---- + 2006-08-11 13:01 ntiffin + + * ChangeLog, Connection.h, Connection.m, DataSource.m, Database.m, + Databases.m, ExplorerModel.m, ExplorerNode.m, Field.m, Fields.m, + Record.h, Record.m, RecordSet.m, Table.m: Fix a number of memory + issues. + 2006-07-16 18:13 ntiffin Index: ExplorerModel.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ExplorerModel.m,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExplorerModel.m 11 Aug 2006 18:01:25 -0000 1.8 --- ExplorerModel.m 12 Aug 2006 16:38:16 -0000 1.9 *************** *** 106,112 **** [newNode setBaseSchema:schemaName]; [titleNode addChild:newNode]; - - [newNode release]; } } } --- 106,111 ---- [newNode setBaseSchema:schemaName]; [titleNode addChild:newNode]; } + [newNode release]; } } Index: Schema.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Schema.m,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Schema.m 16 Jul 2006 23:13:06 -0000 1.16 --- Schema.m 12 Aug 2006 16:38:16 -0000 1.17 *************** *** 23,26 **** --- 23,27 ---- [super init]; + [connection release]; connection = theConnection; [connection retain]; *************** *** 39,43 **** // TODO not found raise error? ! NSLog(@"Did not find PostgreSQL version 8"); NSLog(sql); NSLog(pgVersionFound); --- 40,44 ---- // TODO not found raise error? ! NSLog(@"Did not find PostgreSQL version 8.1"); NSLog(sql); NSLog(pgVersionFound); *************** *** 525,529 **** RecordSet *results; int i; ! NSMutableString * sqlOutput = [[NSMutableString alloc] init]; [sqlOutput appendFormat:@"CREATE TABLE %@.%@ ( ", schemaName, tableName]; if (pretty) --- 526,530 ---- RecordSet *results; int i; ! NSMutableString * sqlOutput = [[[NSMutableString alloc] init] autorelease]; [sqlOutput appendFormat:@"CREATE TABLE %@.%@ ( ", schemaName, tableName]; if (pretty) *************** *** 583,587 **** [sqlOutput appendString:@" );"]; } - [sqlOutput autorelease]; return sqlOutput; } --- 584,587 ---- Index: Fields.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Fields.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Fields.m 11 Aug 2006 18:01:25 -0000 1.5 --- Fields.m 12 Aug 2006 16:38:16 -0000 1.6 *************** *** 15,21 **** { [super init]; - items = [[NSMutableArray alloc] init]; - [items retain]; return self; --- 15,19 ---- Index: Connection.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Connection.m,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Connection.m 11 Aug 2006 18:01:25 -0000 1.12 --- Connection.m 12 Aug 2006 16:38:16 -0000 1.13 *************** *** 33,38 **** host = [[NSString alloc] initWithString:@"localhost"]; port = [[NSString alloc] initWithString:@"5432"]; ! options = [[NSString alloc] init]; ! tty = [[NSString alloc] init]; dbName = [[NSString alloc] initWithString:@"template1"]; --- 33,38 ---- host = [[NSString alloc] initWithString:@"localhost"]; port = [[NSString alloc] initWithString:@"5432"]; ! options = nil; ! tty = nil; dbName = [[NSString alloc] initWithString:@"template1"]; *************** *** 85,91 **** NSLog(@"Connection to database '%@' failed.", dbName); NSLog(@"\t%s", PQerrorMessage(pgconn)); ! [errorDescription release]; ! errorDescription = [[NSString alloc] initWithFormat:@"%s", PQerrorMessage(pgconn)]; ! [[errorDescription retain] autorelease]; [self appendSQLLog:[NSMutableString stringWithFormat:@"Connection to database %@ Failed.\n", dbName]]; --- 85,89 ---- NSLog(@"Connection to database '%@' failed.", dbName); NSLog(@"\t%s", PQerrorMessage(pgconn)); ! [self setErrorDescription:[NSString stringWithFormat:@"%s", PQerrorMessage(pgconn)]]; [self appendSQLLog:[NSMutableString stringWithFormat:@"Connection to database %@ Failed.\n", dbName]]; *************** *** 260,266 **** if (PQresultStatus(res) != PGRES_TUPLES_OK) { ! [errorDescription release]; ! errorDescription = [[NSString alloc] initWithString:@"Command did not return any data."]; ! [[errorDescription retain] autorelease]; PQclear(res); return nil; --- 258,262 ---- if (PQresultStatus(res) != PGRES_TUPLES_OK) { ! [self setErrorDescription:[NSString stringWithString:@"Command did not return any data."]]; PQclear(res); return nil; *************** *** 268,272 **** // build the collection ! dbs = [[[[Databases alloc] init] retain] autorelease]; long nFields = PQnfields(res); long nRecords = PQntuples(res); --- 264,269 ---- // build the collection ! [dbs release]; ! dbs = [[Databases alloc] init]; long nFields = PQnfields(res); long nRecords = PQntuples(res); *************** *** 281,285 **** for ( x = 0; x < nFields; x++) { ! NSString *fValue = [[NSString alloc] initWithCString:PQgetvalue(res, i, x)]; switch (x) --- 278,282 ---- for ( x = 0; x < nFields; x++) { ! NSString *fValue = [[[NSString alloc] initWithCString:PQgetvalue(res, i, x)] autorelease]; switch (x) *************** *** 320,326 **** - (void)setErrorDescription:(NSString *)ed; { [errorDescription release]; errorDescription = ed; - [errorDescription retain]; } --- 317,323 ---- - (void)setErrorDescription:(NSString *)ed; { + [ed retain]; [errorDescription release]; errorDescription = ed; } *************** *** 335,340 **** { [sqlLog release]; ! sqlLog = [NSMutableString stringWithString:value]; ! [sqlLog retain]; } --- 332,336 ---- { [sqlLog release]; ! sqlLog = [[NSMutableString alloc] initWithString:value]; } *************** *** 343,348 **** if (sqlLog == nil) { ! sqlLog = [NSMutableString stringWithString:value]; ! [sqlLog retain]; } else --- 339,343 ---- if (sqlLog == nil) { ! sqlLog = [[NSMutableString alloc] initWithString:value]; } else *************** *** 501,507 **** if (strlen(PQcmdStatus(res))) { ! [self appendSQLLog:[[NSString alloc] initWithFormat:@"%s\n", PQcmdStatus(res)]]; } ! results = [[[[NSString alloc] initWithCString:PQcmdTuples(res)] retain] autorelease]; PQclear(res); return results; --- 496,502 ---- if (strlen(PQcmdStatus(res))) { ! [self appendSQLLog:[NSString stringWithFormat:@"%s\n", PQcmdStatus(res)]]; } ! results = [[[NSString alloc] initWithCString:PQcmdTuples(res)] autorelease]; PQclear(res); return results; Index: ExplorerNode.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ExplorerNode.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExplorerNode.m 11 Aug 2006 18:01:25 -0000 1.5 --- ExplorerNode.m 12 Aug 2006 16:38:16 -0000 1.6 *************** *** 91,95 **** [name release]; name = [[NSAttributedString alloc] initWithString:s]; - [name retain]; } --- 91,94 ---- Index: Databases.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Databases.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Databases.m 11 Aug 2006 18:01:25 -0000 1.3 --- Databases.m 12 Aug 2006 16:38:16 -0000 1.4 *************** *** 17,21 **** items = [[NSMutableArray alloc] init]; - [items retain]; return self; --- 17,20 ---- Index: Field.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Field.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Field.m 11 Aug 2006 18:01:25 -0000 1.3 --- Field.m 12 Aug 2006 16:38:16 -0000 1.4 *************** *** 16,21 **** [super init]; ! name = [[[[NSString alloc] init] retain] autorelease]; ! value = [[[[NSString alloc] init] retain] autorelease]; return self; --- 16,21 ---- [super init]; ! name = nil; ! value = nil; return self; *************** *** 38,42 **** if (name != newName) { [name release]; ! name = [newName copy]; } } --- 38,43 ---- if (name != newName) { [name release]; ! name = newName; ! [name retain]; } } *************** *** 49,53 **** if (value != newValue) { [value release]; ! value = [newValue copy]; } } --- 50,55 ---- if (value != newValue) { [value release]; ! value = newValue; ! [value retain]; } } |