Fixed memory leak

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7325 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2000-09-01 20:35:22 +00:00
parent 5510e57ed7
commit 400e191b8c

View file

@ -2552,13 +2552,13 @@
int i; int i;
// create a new col matrix // create a new col matrix
matrix = [[[_browserMatrixClass alloc] matrix = [_browserMatrixClass alloc];
initWithFrame: matrixRect matrix = [matrix initWithFrame: matrixRect
mode: NSListModeMatrix mode: NSListModeMatrix
prototype: _browserCellPrototype prototype: _browserCellPrototype
numberOfRows: n numberOfRows: n
numberOfColumns: 1] numberOfColumns: 1];
autorelease]; AUTORELEASE (matrix);
[matrix setAllowsEmptySelection: _allowsEmptySelection]; [matrix setAllowsEmptySelection: _allowsEmptySelection];
if (!_allowsMultipleSelection) if (!_allowsMultipleSelection)
[matrix setMode: NSRadioModeMatrix]; [matrix setMode: NSRadioModeMatrix];
@ -2582,7 +2582,6 @@
} }
else else
{ {
//NSRect matrixRect = {{0, 0}, {100, 100}};
// create a new col matrix // create a new col matrix
matrix = [_browserMatrixClass alloc]; matrix = [_browserMatrixClass alloc];
[matrix initWithFrame: matrixRect [matrix initWithFrame: matrixRect
@ -2590,6 +2589,7 @@
prototype: _browserCellPrototype prototype: _browserCellPrototype
numberOfRows: 0 numberOfRows: 0
numberOfColumns: 0]; numberOfColumns: 0];
AUTORELEASE (matrix);
[matrix setAllowsEmptySelection: _allowsEmptySelection]; [matrix setAllowsEmptySelection: _allowsEmptySelection];
if (_allowsMultipleSelection) if (_allowsMultipleSelection)
[matrix setMode: NSListModeMatrix]; [matrix setMode: NSListModeMatrix];