Skip to content

Commit

Permalink
fix(ios): avoid over release of list item proxies
Browse files Browse the repository at this point in the history
avoid explicitly releasing modelDelgate as _destroy handles that and
guards against releasing self

Fixes TIMOB-28127
  • Loading branch information
sgtcoolguy committed Sep 29, 2020
1 parent de88803 commit 6d22e29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 8 additions & 8 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ @interface TiUIListView ()

@implementation TiUIListView {
UITableView *_tableView;
NSDictionary *_templates;
NSDictionary<id, TiViewTemplate *> *_templates;
id _defaultItemTemplate;

TiDimension _rowHeight;
Expand All @@ -46,10 +46,10 @@ @implementation TiUIListView {
UISearchController *searchController;
UIViewController *searchControllerPresenter;

NSMutableArray *sectionTitles;
NSMutableArray *sectionIndices;
NSMutableArray *filteredTitles;
NSMutableArray *filteredIndices;
NSMutableArray<NSString *> *sectionTitles;
NSMutableArray<NSNumber *> *sectionIndices;
NSMutableArray<NSString *> *filteredTitles;
NSMutableArray<NSNumber *> *filteredIndices;

UIView *_pullViewWrapper;
CGFloat pullThreshhold;
Expand All @@ -67,7 +67,7 @@ @implementation TiUIListView {
UIEdgeInsets _defaultSeparatorInsets;
UIEdgeInsets _rowSeparatorInsets;

NSMutableDictionary *_measureProxies;
NSMutableDictionary<id, TiUIListItem *> *_measureProxies;

BOOL canFireScrollStart;
BOOL canFireScrollEnd;
Expand Down Expand Up @@ -509,7 +509,7 @@ - (void)buildResultsForSearchText
if (sectionTitles != nil && sectionIndices != nil) {
NSNumber *theIndex = [NSNumber numberWithInt:i];
if ([sectionIndices containsObject:theIndex]) {
id theTitle = [sectionTitles objectAtIndex:[sectionIndices indexOfObject:theIndex]];
NSString *theTitle = [sectionTitles objectAtIndex:[sectionIndices indexOfObject:theIndex]];
if (filteredTitles == nil) {
filteredTitles = [[NSMutableArray alloc] init];
}
Expand Down Expand Up @@ -989,7 +989,7 @@ - (void)setSectionIndexTitles_:(id)args

#pragma mark - SectionIndexTitle Support Datasource methods.

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
- (NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
if (editing) {
return nil;
Expand Down
1 change: 0 additions & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/TiProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ - (void)dealloc
#if PROXY_MEMORY_TRACK == 1
NSLog(@"[DEBUG] DEALLOC: %@ (%d)", self, [self hash]);
#endif
RELEASE_TO_NIL(modelDelegate);
[self _destroy];
pthread_rwlock_destroy(&listenerLock);
pthread_rwlock_destroy(&dynpropsLock);
Expand Down

0 comments on commit 6d22e29

Please sign in to comment.