Revision: 29708
http://sourceforge.net/p/bibdesk/svn/29708
Author: hofman
Date: 2025-10-12 08:50:42 +0000 (Sun, 12 Oct 2025)
Log Message:
-----------
use hash table for found net services to make sure we compare the identical
objects, as NSNetService overrides isEqual:
Modified Paths:
--------------
trunk/bibdesk/BDSKSharingBrowser.h
trunk/bibdesk/BDSKSharingBrowser.m
Modified: trunk/bibdesk/BDSKSharingBrowser.h
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.h 2025-10-11 17:01:47 UTC (rev 29707)
+++ trunk/bibdesk/BDSKSharingBrowser.h 2025-10-12 08:50:42 UTC (rev 29708)
@@ -45,8 +45,8 @@
@interface BDSKSharingBrowser : NSObject <NSNetServiceDelegate,
NSNetServiceBrowserDelegate> {
NSMutableSet *sharingClients;
NSNetServiceBrowser *browser;
- NSMutableSet *unresolvedNetServices;
- NSMutableSet *undecidedNetServices;
+ NSHashTable *unresolvedNetServices;
+ NSHashTable *undecidedNetServices;
}
@property (class, nonatomic, readonly) BDSKSharingBrowser *sharedBrowser;
Modified: trunk/bibdesk/BDSKSharingBrowser.m
===================================================================
--- trunk/bibdesk/BDSKSharingBrowser.m 2025-10-11 17:01:47 UTC (rev 29707)
+++ trunk/bibdesk/BDSKSharingBrowser.m 2025-10-12 08:50:42 UTC (rev 29708)
@@ -196,8 +196,8 @@
browser = [[NSNetServiceBrowser alloc] init];
[browser setDelegate:self];
[browser searchForServicesOfType:BDSKNetServiceDomain inDomain:@""];
- unresolvedNetServices = [[NSMutableSet alloc] initWithCapacity:5];
- undecidedNetServices = [[NSMutableSet alloc] initWithCapacity:1];
+ unresolvedNetServices = [[NSHashTable alloc]
initWithOptions:NSHashTableStrongMemory | NSHashTableObjectPointerPersonality
capacity:5];
+ undecidedNetServices = [[NSHashTable alloc]
initWithOptions:NSHashTableStrongMemory | NSHashTableObjectPointerPersonality
capacity:1];
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc postNotificationName:BDSKSharingClientsChangedNotification
object:self];
@@ -213,7 +213,7 @@
browser = nil;
- [unresolvedNetServices setValue:nil forKey:@"delegate"];
+ [[unresolvedNetServices allObjects] setValue:nil forKey:@"delegate"];
unresolvedNetServices = nil;
if ([undecidedNetServices count])
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