diff --git a/ChangeLog b/ChangeLog index 56a890a4f..f658b2ccf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ 2000-10-19 Michael Hanni * Source/NSTabView.m: a few bugfixes. + * Source/NSTabViewItem.m: fixed a few memory leaks. 2000-10-17 Fred Kiefer diff --git a/Source/NSTabView.m b/Source/NSTabView.m index 90ab35577..f6decc456 100644 --- a/Source/NSTabView.m +++ b/Source/NSTabView.m @@ -111,6 +111,7 @@ if ([[anItem identifier] isEqual: identifier]) return i; } + return NSNotFound; } @@ -185,10 +186,10 @@ tab_selected_item = [tab_items indexOfObject: tab_selected]; [tab_selected _setTabState: NSSelectedTab]; -// [self setNeedsDisplay: YES]; - if ([tab_selected view]) - [self addSubview: [tab_selected view]]; + { + [self addSubview: [tab_selected view]]; + } [self setNeedsDisplay: YES]; @@ -291,9 +292,6 @@ { NSRect cRect = _bounds; -// cRect.origin.x = 0; -// cRect.origin.y = 0; - if (tab_type == NSTopTabsBezelBorder) { cRect.origin.y += 1; @@ -336,8 +334,9 @@ switch (tab_type) { case NSTopTabsBezelBorder: + aRect.size.height -= 16; rect.size.height -= 16; - NSDrawButton(rect, NSZeroRect); + NSDrawButton(aRect, NSZeroRect); borderThickness = 2; break; @@ -657,10 +656,6 @@ [self selectTabViewItem: anItem]; } - // [self setNeedsDisplay: YES]; - -// [_window update]; - return [super hitTest: aPoint]; } diff --git a/Source/NSTabViewItem.m b/Source/NSTabViewItem.m index 653024ef9..6243d1504 100644 --- a/Source/NSTabViewItem.m +++ b/Source/NSTabViewItem.m @@ -60,6 +60,9 @@ - (void)setView:(NSView *)view { + if (item_view) + RELEASE(item_view); + ASSIGN(item_view, view); } @@ -96,7 +99,7 @@ - (void)_setTabView:(NSTabView *)tabView { - ASSIGN(item_tabview, tabView); + item_tabview = tabView; } - (NSTabView *)tabView