mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Fix memory leaks found by analyser.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32255 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c67cd8b4f8
commit
6daffd89d7
6 changed files with 28 additions and 15 deletions
|
@ -1,3 +1,11 @@
|
|||
2011-02-20 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSWindow.m,
|
||||
* Source/NSControl.m,
|
||||
* ColorPickers/GSStandardColorPicker.m,
|
||||
* ColorPickers/GSWheelColorPicker.m,
|
||||
* Source/GSXibLoader.m: Fix memory leaks found by analyser.
|
||||
|
||||
2011-02-20 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSFusedSilica.h,
|
||||
|
|
|
@ -314,8 +314,12 @@
|
|||
for (i = 0; i < numFields; i++)
|
||||
{
|
||||
NSSlider *s;
|
||||
NSCell *c;
|
||||
|
||||
s = sliders[i] = [[NSSlider alloc] initWithFrame: NSMakeRect(0, 0, 0, 16)];
|
||||
[s setCell: [[GSColorSliderCell alloc] init]];
|
||||
c = [[GSColorSliderCell alloc] init];
|
||||
[s setCell: c];
|
||||
RELEASE(c);
|
||||
[s setContinuous: YES];
|
||||
[s setMinValue: 0.0];
|
||||
[s setTitle: names[i]];
|
||||
|
|
|
@ -449,6 +449,7 @@
|
|||
- (void) loadViews
|
||||
{
|
||||
NSSlider *s;
|
||||
NSCell *c;
|
||||
|
||||
baseView = [[GSHbox alloc] init];
|
||||
[baseView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
|
||||
|
@ -461,7 +462,9 @@
|
|||
|
||||
s = brightnessSlider = [[NSSlider alloc] initWithFrame: NSMakeRect(0,0,16,0)];
|
||||
[s setAutoresizingMask: NSViewHeightSizable];
|
||||
[s setCell: [[GSColorSliderCell alloc] init]];
|
||||
c = [[GSColorSliderCell alloc] init];
|
||||
[s setCell: c];
|
||||
RELEASE(c);
|
||||
[(GSColorSliderCell *)[s cell] _setColorSliderCellMode: 10];
|
||||
[s setContinuous: YES];
|
||||
[s setMinValue: 0.0];
|
||||
|
|
|
@ -849,6 +849,8 @@ didStartElement: (NSString *)elementName
|
|||
|
||||
// Create instance.
|
||||
o = [c allocWithZone: [self zone]];
|
||||
// Make sure the object stays around, even when replaced.
|
||||
RETAIN(o);
|
||||
if (key != nil)
|
||||
[decoded setObject: o forKey: key];
|
||||
r = [o initWithCoder: self];
|
||||
|
@ -857,7 +859,7 @@ didStartElement: (NSString *)elementName
|
|||
[delegate unarchiver: self
|
||||
willReplaceObject: o
|
||||
withObject: r];
|
||||
o = r;
|
||||
ASSIGN(o, r);
|
||||
if (key != nil)
|
||||
[decoded setObject: o forKey: key];
|
||||
}
|
||||
|
@ -867,7 +869,7 @@ didStartElement: (NSString *)elementName
|
|||
[delegate unarchiver: self
|
||||
willReplaceObject: o
|
||||
withObject: r];
|
||||
o = r;
|
||||
ASSIGN(o, r);
|
||||
if (key != nil)
|
||||
[decoded setObject: o forKey: key];
|
||||
}
|
||||
|
@ -879,23 +881,18 @@ didStartElement: (NSString *)elementName
|
|||
[delegate unarchiver: self
|
||||
willReplaceObject: o
|
||||
withObject: r];
|
||||
o = r;
|
||||
ASSIGN(o, r);
|
||||
if (key != nil)
|
||||
[decoded setObject: o forKey: key];
|
||||
}
|
||||
}
|
||||
if (key != nil)
|
||||
{
|
||||
// Retained in decoded
|
||||
RELEASE(o);
|
||||
}
|
||||
else
|
||||
AUTORELEASE(o);
|
||||
// Balance the retain above
|
||||
RELEASE(o);
|
||||
|
||||
// pop
|
||||
currentElement = last;
|
||||
|
||||
return o;
|
||||
return AUTORELEASE(o);
|
||||
}
|
||||
else if ([@"string" isEqualToString: elementName])
|
||||
{
|
||||
|
|
|
@ -962,7 +962,7 @@ static NSNotificationCenter *nc;
|
|||
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
NSCell *cell = RETAIN([aDecoder decodeObjectForKey: @"NSCell"]);
|
||||
NSCell *cell = [aDecoder decodeObjectForKey: @"NSCell"];
|
||||
|
||||
if (cell != nil)
|
||||
{
|
||||
|
@ -972,7 +972,7 @@ static NSNotificationCenter *nc;
|
|||
{
|
||||
// This is needed for subclasses without cells, like NSColorWeel
|
||||
// as we store some properties only on the cell.
|
||||
NSCell *cell = [[[self class] cellClass] new];
|
||||
cell = [[[self class] cellClass] new];
|
||||
|
||||
[self setCell: cell];
|
||||
RELEASE(cell);
|
||||
|
|
|
@ -1116,6 +1116,7 @@ many times.
|
|||
backing: bufferingType
|
||||
defer: YES
|
||||
screen: aScreen];
|
||||
RELEASE(aScreen);
|
||||
|
||||
// Fake the initialisation of the backend
|
||||
_windowNum = winNum;
|
||||
|
|
Loading…
Reference in a new issue