mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Memory leak fixed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4504 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7dab90481b
commit
820482b623
2 changed files with 18 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
Fre Jul 2 8:45:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSUnarchiver.m: In designated initialiser, catch exceptions
|
||||
and deallocate self before re-throwing in order to prevent memory
|
||||
leak.
|
||||
|
||||
Thu Jul 1 14:00:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
Patch by Kai Henningsen to improve debug slightly.
|
||||
|
|
|
@ -309,10 +309,9 @@ mapClassName(NSUnarchiverObjectInfo *info)
|
|||
NSUnarchiver *unarchiver;
|
||||
id obj;
|
||||
|
||||
unarchiver = [self allocWithZone: NSDefaultMallocZone()];
|
||||
unarchiver = [[self alloc] initForReadingWithData: anObject];
|
||||
NS_DURING
|
||||
{
|
||||
unarchiver = [unarchiver initForReadingWithData: anObject];
|
||||
obj = [unarchiver decodeObject];
|
||||
}
|
||||
NS_HANDLER
|
||||
|
@ -386,7 +385,16 @@ mapClassName(NSUnarchiverObjectInfo *info)
|
|||
objDict = [[NSMutableDictionary allocWithZone: zone]
|
||||
initWithCapacity: 200];
|
||||
|
||||
[self resetUnarchiverWithData: anObject atIndex: 0];
|
||||
NS_DURING
|
||||
{
|
||||
[self resetUnarchiverWithData: anObject atIndex: 0];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
RELEASE(self);
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -1198,7 +1206,7 @@ mapClassName(NSUnarchiverObjectInfo *info)
|
|||
{
|
||||
Class c;
|
||||
|
||||
RELEASE(data);
|
||||
TEST_RELEASE(data);
|
||||
data = RETAIN(anObject);
|
||||
c = fastClass(data);
|
||||
if (src != self)
|
||||
|
|
Loading…
Reference in a new issue