From a7894607af09a19686590a23db96b68bad54aeb2 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Mon, 24 Jul 2023 14:14:17 -0400 Subject: [PATCH] Update internal data source --- Source/NSOutlineView.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index 4a07c63fb..96a079ce5 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -105,7 +105,7 @@ static NSDate *lastDragChange = nil; NSString *_childrenKeyPath; NSString *_leafKeyPath; - NSMutableDictionary *_internalRepresentation; + NSMapTable *_internalRepresentation; id _observedObject; NSOutlineView *_outlineView; } @@ -2284,7 +2284,7 @@ Also returns the child index relative to this parent. */ ASSIGNCOPY(_childrenKeyPath, [tc childrenKeyPath]); ASSIGNCOPY(_countKeyPath, [tc countKeyPath]); - _internalRepresentation = [[NSMutableDictionary alloc] init]; + _internalRepresentation = RETAIN([NSMapTable weakToWeakObjectsMapTable]); } else { @@ -2354,6 +2354,7 @@ Also returns the child index relative to this parent. */ if (_theBinding != nil) { NSArray *contentArray = (NSArray *)[_theBinding destinationValue]; + [_internalRepresentation removeAllObjects]; [self _collectNodes: contentArray]; NSLog(@"_internalRepresentation = %@", _internalRepresentation); }