Revision: 28562
http://sourceforge.net/p/bibdesk/svn/28562
Author: hofman
Date: 2024-01-06 18:18:26 +0000 (Sat, 06 Jan 2024)
Log Message:
-----------
use weak block variable inside block to avoid retain cycle
Modified Paths:
--------------
trunk/bibdesk/BDSKFormatParser.m
Modified: trunk/bibdesk/BDSKFormatParser.m
===================================================================
--- trunk/bibdesk/BDSKFormatParser.m 2024-01-06 18:12:46 UTC (rev 28561)
+++ trunk/bibdesk/BDSKFormatParser.m 2024-01-06 18:18:26 UTC (rev 28562)
@@ -872,13 +872,14 @@
char chs[n + 1], *chars = chs;
memset(chs, '\0', n + 1);
- __block NSString *(^uniqueString)(NSUInteger) = ^NSString *(NSUInteger
i) {
+ __weak __block NSString *(^weakUniqueString)(NSUInteger);
+ NSString *(^uniqueString)(NSUInteger) = ^NSString *(NSUInteger i) {
if (i < n) {
char c;
for (c = charRange.location; c < (char)NSMaxRange(charRange);
c++) {
if (number == 0 && i == 0 && c == '0') continue;
chars[i] = c;
- NSString *str = uniqueString(i + 1);
+ NSString *str = weakUniqueString(i + 1);
if (str) return str;
}
return nil;
@@ -886,6 +887,7 @@
return validator(fullString(baseStr, endStr, chars));
}
};
+ weakUniqueString = uniqueString;
if ((uniqueStr = uniqueString(0)))
return uniqueStr;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit