Fix leak and add to maps in makeItemWithIdentifier:forIndexPath:, per review

This commit is contained in:
Gregory John Casamento 2022-12-12 07:30:31 -05:00
parent cd52649076
commit 8afffbb121

View file

@ -1577,6 +1577,14 @@ static NSString *_placeholderItem = nil;
NSLog(@"Could not load model %@", nib);
}
RELEASE(nib);
// Add to maps...
[_itemsToIndexPaths setObject: indexPath
forKey: item];
[_indexPathsToItems setObject: item
forKey: indexPath];
return item;
}
@ -1722,10 +1730,6 @@ static NSString *_placeholderItem = nil;
[_itemsToAttributes setObject: attrs
forKey: item];
[_itemsToIndexPaths setObject: path
forKey: item];
[_indexPathsToItems setObject: item
forKey: path];
[self addSubview: v];
}