Skip to content

Commit 86aaa25

Browse files
committed
Fix objc weak errors by removing an unused delegate (#3062)
This code still seems wrong, though: -tableView:objectValueForTableColumn:row: is not the appropriate place to return cell objects
1 parent f517fd3 commit 86aaa25

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Source/SPNarrowDownCompletion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
@class SPDatabaseStructure;
3434

35-
@interface SPNarrowDownCompletion : NSWindow <NSTableViewDelegate, NSTableViewDataSource, NSTokenFieldCellDelegate>
35+
@interface SPNarrowDownCompletion : NSWindow <NSTableViewDelegate, NSTableViewDataSource>
3636
{
3737
NSArray* suggestions;
3838
NSMutableString* mutablePrefix;

Source/SPNarrowDownCompletion.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ - (void)dealloc
163163
SPClear(mutablePrefix);
164164
SPClear(textualInputCharacters);
165165
SPClear(originalFilterString);
166+
[theTableView setDataSource:nil];
167+
[theTableView setDelegate:nil];
168+
SPClear(theTableView);
166169
if (staticPrefix) SPClear(staticPrefix);
167170
if (syncArrowImages) SPClear(syncArrowImages);
168171
if (suggestions) SPClear(suggestions);
@@ -353,7 +356,7 @@ - (void)setupInterface
353356
[[scrollView verticalScroller] setControlSize:NSSmallControlSize];
354357
[[scrollView horizontalScroller] setControlSize:NSSmallControlSize];
355358

356-
theTableView = [[[NSTableView alloc] initWithFrame:NSZeroRect] autorelease];
359+
theTableView = [[NSTableView alloc] initWithFrame:NSZeroRect];
357360
[theTableView setFocusRingType:NSFocusRingTypeNone];
358361
[theTableView setAllowsEmptySelection:YES];
359362
[theTableView setHeaderView:nil];
@@ -557,7 +560,6 @@ - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColu
557560
[b setEditable:NO];
558561
[b setAlignment:NSRightTextAlignment];
559562
[b setFont:[NSFont systemFontOfSize:11]];
560-
[b setDelegate:self];
561563
return b;
562564
}
563565

0 commit comments

Comments
 (0)