Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-18260](3_5_X)iOS: Removing a ListView while SearchBar has focus results in crash #6514

Merged
merged 3 commits into from
Dec 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,23 @@ -(void)setSearchView_:(id)args

}

-(void)cleanup:(id)unused
{
if ([searchController isActive]) {
[searchController setActive:NO animated:NO];
}

if (_headerViewProxy != nil) {
[_headerViewProxy windowWillClose];
[_headerViewProxy windowDidClose];
}

if (_footerViewProxy != nil) {
[_footerViewProxy windowWillClose];
[_footerViewProxy windowDidClose];
}
}

#pragma mark - SectionIndexTitle Support

-(void)setSectionIndexTitles_:(id)args
Expand Down
9 changes: 9 additions & 0 deletions iphone/Classes/TiUIListViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ -(NSString*)apiName
return @"Ti.UI.ListView";
}

- (void)windowWillClose
{
if([self viewInitialized])
{
[self makeViewPerformSelector:@selector(cleanup:) withObject:nil createIfNeeded:NO waitUntilDone:YES];
}
[super windowWillClose];
}

- (void)dealloc
{
[_operationQueue release];
Expand Down
9 changes: 9 additions & 0 deletions iphone/Classes/TiUISearchBarProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ -(void)focus:(id)args
[self makeViewPerformSelector:@selector(focus:) withObject:args createIfNeeded:YES waitUntilDone:NO];
}

- (void)windowWillClose
{
if([self viewInitialized])
{
[self makeViewPerformSelector:@selector(blur:) withObject:nil createIfNeeded:NO waitUntilDone:YES];
}
[super windowWillClose];
}

-(void)setShowCancel:(id)value withObject:(id)object
{
BOOL boolValue = [TiUtils boolValue:value];
Expand Down
2 changes: 2 additions & 0 deletions iphone/Classes/TiUIiPadPopoverProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ - (BOOL)popoverPresentationControllerShouldDismissPopover:(UIPopoverPresentation
if ([[self viewController] presentedViewController] != nil) {
return NO;
}
[contentViewProxy windowWillClose];
return YES;
}

Expand Down Expand Up @@ -555,6 +556,7 @@ - (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)thisPopover
return NO;
}
}
[contentViewProxy windowWillClose];
return YES;
}

Expand Down