Revision: 13817
http://sourceforge.net/p/skim-app/code/13817
Author: hofman
Date: 2023-11-30 15:44:43 +0000 (Thu, 30 Nov 2023)
Log Message:
-----------
use atomic associated object
Modified Paths:
--------------
trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2023-11-30 15:33:21 UTC
(rev 13816)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2023-11-30 15:44:43 UTC
(rev 13817)
@@ -859,26 +859,26 @@
}
- (BOOL)isSkimNote {
+#if !defined(PDFKIT_PLATFORM_IOS) && MAC_OS_X_VERSION_MIN_REQUIRED <
MAC_OS_X_VERSION_10_6
BOOL isSkimNote;
@synchronized([PDFAnnotation self]) {
-#if !defined(PDFKIT_PLATFORM_IOS) && MAC_OS_X_VERSION_MIN_REQUIRED <
MAC_OS_X_VERSION_10_6
isSkimNote = [SkimNotes containsObject:self];
+ }
+ return isSkimNote;
#else
- isSkimNote = [objc_getAssociatedObject(self, &SKNIsSkimNoteKey)
boolValue];
+ return [objc_getAssociatedObject(self, &SKNIsSkimNoteKey) boolValue];
#endif
- }
- return isSkimNote;
}
- (void)setSkimNote:(BOOL)flag {
+#if !defined(PDFKIT_PLATFORM_IOS) && MAC_OS_X_VERSION_MIN_REQUIRED <
MAC_OS_X_VERSION_10_6
@synchronized([PDFAnnotation self]) {
-#if !defined(PDFKIT_PLATFORM_IOS) && MAC_OS_X_VERSION_MIN_REQUIRED <
MAC_OS_X_VERSION_10_6
if (flag) [SkimNotes addObject:self];
else [SkimNotes removeObject:self];
+ }
#else
- objc_setAssociatedObject(self, &SKNIsSkimNoteKey, flag ? [NSNumber
numberWithBool:YES] : nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+ objc_setAssociatedObject(self, &SKNIsSkimNoteKey, flag ? [NSNumber
numberWithBool:YES] : nil, OBJC_ASSOCIATION_RETAIN);
#endif
- }
}
- (NSString *)string {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit