From b50d4e9a6f55c26d3fbe33b33d78063ad1e9e9fd Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 15 May 2017 01:06:05 +0200 Subject: Apply changes from 23c4d04e433f9eb21872edacc41173e34ec45ac2 to SPTableContent (#2775) --- Source/SPTableContent.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 0d33c1ae..4e3ee245 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -81,6 +81,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper @interface SPTableContent () - (BOOL)cancelRowEditing; +- (void)documentWillClose:(NSNotification *)notification; @end @@ -292,6 +293,10 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper selector:@selector(endDocumentTaskForTab:) name:SPDocumentTaskEndNotification object:tableDocumentInstance]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(documentWillClose:) + name:SPDocumentWillCloseNotification + object:tableDocumentInstance]; } #pragma mark - @@ -4135,6 +4140,13 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper tableRowsSelectable = YES; } +//this method is called right before the UI objects are deallocated +- (void)documentWillClose:(NSNotification *)notification +{ + // if a result load is in progress we must stop the timer or it may try to call invalid IBOutlets + [self clearTableLoadTimer]; +} + #pragma mark - #pragma mark KVO methods -- cgit v1.2.3