From 1ec70f9323c1fc6772381b5ac44fdf3a850c56f7 Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 28 Nov 2024 17:51:45 +0000 Subject: [PATCH] fix for ARC and bug in date comparison --- SQLClient.h | 6 ++++-- SQLClient.m | 9 --------- SQLClientPool.m | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/SQLClient.h b/SQLClient.h index 2c78f02..6db0228 100644 --- a/SQLClient.h +++ b/SQLClient.h @@ -2256,7 +2256,8 @@ SQLCLIENT_PRIVATE /** Creates and returns a copy of aString as a literal, * whether or not aString is already a literal string. */ -extern SQLLiteral * SQLClientCopyLiteral(NSString *aString); +extern SQLLiteral * SQLClientCopyLiteral(NSString *aString) + NS_RETURNS_RETAINED; /** Function to test an object to see if it is considered to be a literal * string by SQLClient. Use this rather than trying to chewck the class @@ -2277,7 +2278,8 @@ extern SQLLiteral * SQLClientMakeLiteral(NSString *aString); * from a UTF8 or ASCII C string whose length (not including any nul * terminator) is the specified count. */ -extern SQLLiteral * SQLClientNewLiteral(const char *bytes, unsigned count); +extern SQLLiteral * SQLClientNewLiteral(const char *bytes, unsigned count) + NS_RETURNS_RETAINED; /** Creates and returns an autoreleased proxy to aString, recording the * fact that the programmer considers the string to be a valid literal diff --git a/SQLClient.m b/SQLClient.m index 3bb1ece..6994ff0 100644 --- a/SQLClient.m +++ b/SQLClient.m @@ -5398,15 +5398,6 @@ nextUTF8(const uint8_t *p, unsigned l, unsigned *o, unichar *n) return [super dataUsingEncoding: encoding allowLossyConversion: flag]; } -- (void) dealloc -{ - utf8Bytes = NULL; // Break reference loops - byteLen = 0; - charLen = 0; - hasHash = NO; - DEALLOC -} - - (void) getCharacters: (unichar*)buffer range: (NSRange)aRange { diff --git a/SQLClientPool.m b/SQLClientPool.m index 1f5fffd..9849c63 100644 --- a/SQLClientPool.m +++ b/SQLClientPool.m @@ -893,7 +893,7 @@ static Class cls = Nil; */ locked = [_lock tryLockWhenCondition: 1]; } - else if ([when earlierDate: until] == until) + else if ([when earlierDate: until] != when) { locked = [_lock lockWhenCondition: 1 beforeDate: until]; }