aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPIndexesController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPIndexesController.m')
-rw-r--r--Source/SPIndexesController.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m
index 8058ff3f..92a0ddf6 100644
--- a/Source/SPIndexesController.m
+++ b/Source/SPIndexesController.m
@@ -79,6 +79,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
#endif
if ((self = [super initWithWindowNibName:nibName])) {
+ _mainNibLoaded = NO;
table = @"";
fields = [[NSMutableArray alloc] init];
@@ -114,6 +115,11 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
*/
- (void)awakeFromNib
{
+
+ // As this controller also loads its own nib, it may call awakeFromNib multiple times; perform setup only once.
+ if (_mainNibLoaded) return;
+ _mainNibLoaded = YES;
+
#ifndef SP_REFACTOR /* patch */
// Set the index tables view's vertical gridlines if required
[indexesTableView setGridStyleMask:([prefs boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
@@ -1018,6 +1024,10 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
if (indexedFields) [indexedFields release], indexedFields = nil;
+#ifndef SP_REFACTOR
+ [prefs removeObserver:self forKeyPath:SPDisplayTableViewVerticalGridlines];
+#endif
+
[super dealloc];
}