Applied memory leak fixing patches

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17277 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-07-21 10:41:10 +00:00
parent 98a5680ea4
commit 195b45848e
10 changed files with 53 additions and 16 deletions

View file

@ -1,3 +1,15 @@
2003-07-21 Andrew Ruder <aeruder@ksu.edu>
* Source/GSMemoryPanel.m: Add dealloc method
* Source/NSOutlineView.m: Efficiency tweak.
* Headers/AppKit/NSComboBoxCell.h:Fix misplaced semicolon
* Source/NSSelection.m: Fix memory leak
* Source/NSComboBoxCell.m: Fix misplaced semicolon.
* Source/NSPageLayout.m: Fix memory leak.
* Source/NSMenuView.m: Fix memory leak.
* Source/NSToolbar.m: Fix memory leak and tidy
* Source/GSServicesManager.m: Clarify retain/release of timer.
2003-07-21 Richard Frith-Macdonald <rfm@gnu.org> 2003-07-21 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileWrapper.m: Tidy initialisation and fix leak in * Source/NSFileWrapper.m: Tidy initialisation and fix leak in

View file

@ -44,7 +44,7 @@
float _itemHeight; float _itemHeight;
int _selectedItem; int _selectedItem;
@private; @private
id _popup; id _popup;
} }

View file

@ -277,6 +277,17 @@ static GSMemoryPanel *sharedGSMemoryPanel = nil;
return self; return self;
} }
- (void) dealloc
{
RELEASE(table);
RELEASE(classArray);
RELEASE(countArray);
RELEASE(totalArray);
RELEASE(peakArray);
[super dealloc];
}
- (int) numberOfRowsInTableView: (NSTableView *)aTableView - (int) numberOfRowsInTableView: (NSTableView *)aTableView
{ {
return [countArray count]; return [countArray count];

View file

@ -440,11 +440,11 @@ static NSString *disabledName = @".GNUstepDisabled";
* Check for changes to the services cache every thirty seconds. * Check for changes to the services cache every thirty seconds.
*/ */
manager->_timer = manager->_timer =
[NSTimer scheduledTimerWithTimeInterval: 30.0 RETAIN([NSTimer scheduledTimerWithTimeInterval: 30.0
target: manager target: manager
selector: @selector(loadServices) selector: @selector(loadServices)
userInfo: nil userInfo: nil
repeats: YES]; repeats: YES]);
[manager loadServices]; [manager loadServices];
return manager; return manager;
@ -522,6 +522,7 @@ static NSString *disabledName = @".GNUstepDisabled";
appName = [[NSProcessInfo processInfo] processName]; appName = [[NSProcessInfo processInfo] processName];
[_timer invalidate]; [_timer invalidate];
RELEASE(_timer);
NSUnregisterServicesProvider(appName); NSUnregisterServicesProvider(appName);
RELEASE(_languages); RELEASE(_languages);
RELEASE(_returnInfo); RELEASE(_returnInfo);

View file

@ -47,7 +47,7 @@
{ {
NSBrowser *browser; NSBrowser *browser;
@private; @private
NSComboBoxCell *_cell; NSComboBoxCell *_cell;
BOOL _stopped; BOOL _stopped;
} }

View file

@ -1410,6 +1410,7 @@ _addLeftBorderOffsetToRect(NSRect aRect)
- (void) dealloc - (void) dealloc
{ {
RELEASE (attr);
RELEASE (button); RELEASE (button);
[super dealloc]; [super dealloc];
} }

View file

@ -129,17 +129,12 @@ static NSImage *unexpandable = nil;
_itemDict = NSCreateMapTable(NSObjectMapKeyCallBacks, _itemDict = NSCreateMapTable(NSObjectMapKeyCallBacks,
NSObjectMapValueCallBacks, NSObjectMapValueCallBacks,
64); 64);
_items = [NSMutableArray array]; _items = [NSMutableArray new];
_expandedItems = [NSMutableArray array]; _expandedItems = [NSMutableArray new];
_levelOfItems = NSCreateMapTable(NSObjectMapKeyCallBacks, _levelOfItems = NSCreateMapTable(NSObjectMapKeyCallBacks,
NSObjectMapValueCallBacks, NSObjectMapValueCallBacks,
64); 64);
// Retain items
RETAIN(_items);
RETAIN(_expandedItems);
return self; return self;
} }

View file

@ -179,6 +179,13 @@ static NSPageLayout *shared_instance;
return self; return self;
} }
- (void) dealloc
{
RELEASE (_accessoryView);
[super dealloc];
}
// //
// Running the Panel // Running the Panel
// //

View file

@ -176,6 +176,14 @@ typedef enum
return self; return self;
} }
- (void) dealloc
{
RELEASE(_descriptionData);
[super dealloc];
}
// //
// Describing a Selection // Describing a Selection
// //

View file

@ -52,11 +52,16 @@ static const int current_version = 1;
@end @end
@implementation GSToolbarView @implementation GSToolbarView
- (void) dealloc
{
RELEASE(_toolbar);
[super dealloc];
}
- (void) setToolbar: (NSToolbar *)toolbar - (void) setToolbar: (NSToolbar *)toolbar
{ {
ASSIGN(_toolbar, toolbar); ASSIGN(_toolbar, toolbar);
} }
- (NSToolbar *) toolbar - (NSToolbar *) toolbar
{ {
return _toolbar; return _toolbar;
@ -182,6 +187,7 @@ static const int current_version = 1;
- (void) dealloc - (void) dealloc
{ {
DESTROY (_identifier); DESTROY (_identifier);
DESTROY (_configurationDictionary);
if (_delegate != nil) if (_delegate != nil)
{ {
@ -242,10 +248,6 @@ static const int current_version = 1;
- (void) setConfigurationFromDictionary: (NSDictionary *)configDict - (void) setConfigurationFromDictionary: (NSDictionary *)configDict
{ {
if(!_configurationDictionary)
{
RELEASE(_configurationDictionary);
}
ASSIGN(_configurationDictionary, configDict); ASSIGN(_configurationDictionary, configDict);
} }