From e4af172ea3bc3bbfe25217231913ee24cc44e33a Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 17 Oct 2001 17:25:25 +0000 Subject: [PATCH] Do not retain/release the data source; it's like a delegate git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11171 72102866-910b-0410-8b05-ffd578937521 --- Source/NSTableView.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 35433de8a..2825ef8be 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -283,7 +283,6 @@ _isCellEditable (id delegate, NSArray *tableColumns, - (void) dealloc { - TEST_RELEASE (_dataSource); RELEASE (_gridColor); RELEASE (_backgroundColor); RELEASE (_tableColumns); @@ -556,7 +555,8 @@ _isCellEditable (id delegate, NSArray *tableColumns, @"tableView:objectValueForTableColumn:row:"]; } - ASSIGN (_dataSource, anObject); + /* We do *not* retain the dataSource, it's like a delegate */ + _dataSource = anObject; [self tile]; [self reloadData]; } @@ -2290,7 +2290,9 @@ byExtendingSelection: (BOOL)flag float x_pos; if (_dataSource == nil) - return; + { + return; + } /* Using columnAtPoint: here would make it called twice per row per drawn rect - so we avoid it and do it natively */ @@ -2869,7 +2871,7 @@ byExtendingSelection: (BOOL)flag self = [super initWithCoder: aDecoder]; - _dataSource = RETAIN([aDecoder decodeObject]); + _dataSource = [aDecoder decodeObject]; _tableColumns = RETAIN([aDecoder decodeObject]); _gridColor = RETAIN([aDecoder decodeObject]); _backgroundColor = RETAIN([aDecoder decodeObject]);