Add -dealloc implementation for SQLString to null-out the pointer and break cyclic references.

This commit is contained in:
rfm 2024-11-28 16:40:34 +00:00
parent 78a66c1a75
commit f84f1f0487

View file

@ -5343,6 +5343,11 @@ nextUTF8(const uint8_t *p, unsigned l, unsigned *o, unichar *n)
NS_ENDHANDLER
}
- (id) copyWithZone: (NSZone*)z
{
return RETAIN(self);
}
- (NSData*) dataUsingEncoding: (NSStringEncoding)encoding
allowLossyConversion: (BOOL)flag
{
@ -5393,6 +5398,15 @@ 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
{
@ -5589,11 +5603,6 @@ nextUTF8(const uint8_t *p, unsigned l, unsigned *o, unichar *n)
return range;
}
- (id) copyWithZone: (NSZone*)z
{
return RETAIN(self);
}
- (NSZone*) zone
{
return NSDefaultMallocZone();