Fix crash when deleting objects.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@10378 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-07-10 05:40:15 +00:00
parent e81456560d
commit 9364950b9e
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2001-07-10 Richard Frith-Macdonald <rfm@gnu.org>
GormDocument.m: ([-detachObject:]) retain object name on entry and
release on exit, or if the object is not in the name table the detach
process could cause the name to be released before we try to use it
to remove the object from the table.
2001-07-09 Richard Frith-Macdonald <rfm@gnu.org>
Gorm.m: Tidied code a little to conform to coding standards

View file

@ -468,7 +468,7 @@ static NSImage *classesImage = nil;
- (void) detachObject: (id)anObject
{
NSString *name = [self nameForObject: anObject];
NSString *name = RETAIN([self nameForObject: anObject]);
unsigned count;
[[self editorForObject: anObject create: NO] close];
@ -496,6 +496,7 @@ static NSImage *classesImage = nil;
[self setObject: anObject isVisibleAtLaunch: NO];
[nameTable removeObjectForKey: name];
RELEASE(name);
}
- (void) detachObjects: (NSArray*)anArray