@@ -6,12 +6,11 @@ @implementation PGConnection - (void)dealloc { [_parameters release]; - if (_connnection != NULL) - PQfinish(_connnection); + [self close]; [super dealloc]; } - (void)setParameters: (OFDictionary*)parameters @@ -55,10 +54,18 @@ - (void)reset { PQreset(_connnection); } + +- (void)close +{ + if (_connnection != NULL) + PQfinish(_connnection); + + _connnection = NULL; +} - (PGResult*)executeCommand: (OFConstantString*)command { PGresult *result = PQexec(_connnection, [command UTF8String]);