Revision: 28500
http://sourceforge.net/p/bibdesk/svn/28500
Author: hofman
Date: 2024-01-01 15:30:23 +0000 (Mon, 01 Jan 2024)
Log Message:
-----------
ignore zone for placeholder icon
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m 2024-01-01 15:08:37 UTC
(rev 28499)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m 2024-01-01 15:30:23 UTC
(rev 28500)
@@ -55,8 +55,6 @@
static Class FVIconClass = Nil;
static NSURL *_missingFileURL = nil;
-static FVPlaceholderIcon *_placeholderIcon = nil;
-
@implementation FVIcon
+ (void)initialize
@@ -65,7 +63,6 @@
FVIconClass = self;
- _placeholderIcon = (FVPlaceholderIcon
*)NSAllocateObject([FVPlaceholderIcon self], 0, NSDefaultMallocZone());
_missingFileURL = [[NSURL alloc]
initWithString:@"x-fileview://localhost/missing"];
[self _initializeCategory];
}
@@ -72,7 +69,16 @@
+ (id)allocWithZone:(NSZone *)aZone
{
- return FVIconClass == self ? _placeholderIcon : [super
allocWithZone:aZone];
+ static FVPlaceholderIcon *_placeholderIcon = nil;
+ static dispatch_once_t onceToken = 0;
+ if (FVIconClass == self) {
+ dispatch_once(&onceToken, ^{
+ _placeholderIcon = [FVPlaceholderIcon allocWithZone:NULL];
+ });
+ return _placeholderIcon;
+ } else {
+ return [super allocWithZone:aZone];
+ }
}
// we only want to encode the public superclass
@@ -145,8 +151,6 @@
- (NSUInteger)retainCount { return NSUIntegerMax; }
-- (NSString *)description { return [NSString stringWithFormat:@"%@:
placeholder for zone %@", [super description], NSZoneName([self zone])]; }
-
- (id)initWithURL:(NSURL *)representedURL;
{
NSParameterAssert(nil != representedURL);
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