mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Memory Leeks from Richard.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2625 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f345d5670d
commit
658a1947fb
7 changed files with 33 additions and 24 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
||||||
|
Wed Nov 12 10:10:33 1997 Adam Fedor <fedor@doc.com>
|
||||||
|
|
||||||
|
* src/NSString.m (-initWithFormat:args:): Print a "null string"
|
||||||
|
when string in format is nil.
|
||||||
|
* src/objc-load.c: Remove ifdef HAVE_CONFIG_H.
|
||||||
|
|
||||||
|
Wed Nov 12 12:30:00 1997 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
|
* src/Collection.m: ([Enumerator -dealloc]) added call dealloction
|
||||||
|
method in super class to fix memory leak.
|
||||||
|
|
||||||
|
* src/KeyedCollection.m: Removed initialisation and deallocation
|
||||||
|
methods for KeyEnumerator as these are done in its super class.
|
||||||
|
|
||||||
|
* src/NSCharacterSet.m: ([-invertedSet:]) added autorelease for data
|
||||||
|
object (created by mutableCopy) in order to fix memory leak.
|
||||||
|
|
||||||
|
* src/NSData.m: Replaced line accidentally deleted in section only
|
||||||
|
compiled in for systems without shared memory.
|
||||||
|
|
||||||
Thu Nov 6 19:00:00 1997 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
Thu Nov 6 19:00:00 1997 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Tools/Makefile.postamble: Modified to install gdomap in cpu/os
|
* Tools/Makefile.postamble: Modified to install gdomap in cpu/os
|
||||||
|
|
|
@ -34,8 +34,12 @@
|
||||||
|
|
||||||
- initWithCollection: coll
|
- initWithCollection: coll
|
||||||
{
|
{
|
||||||
collection = [coll retain];
|
self = [super init];
|
||||||
enum_state = [coll newEnumState];
|
if (self)
|
||||||
|
{
|
||||||
|
collection = [coll retain];
|
||||||
|
enum_state = [coll newEnumState];
|
||||||
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +52,7 @@
|
||||||
{
|
{
|
||||||
[collection freeEnumState: &enum_state];
|
[collection freeEnumState: &enum_state];
|
||||||
[collection release];
|
[collection release];
|
||||||
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -31,13 +31,6 @@
|
||||||
|
|
||||||
@implementation KeyEnumerator
|
@implementation KeyEnumerator
|
||||||
|
|
||||||
- initWithCollection: coll
|
|
||||||
{
|
|
||||||
collection = [coll retain];
|
|
||||||
enum_state = [coll newEnumState];
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- nextObject
|
- nextObject
|
||||||
{
|
{
|
||||||
id k;
|
id k;
|
||||||
|
@ -45,17 +38,6 @@
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
|
||||||
{
|
|
||||||
[collection freeEnumState: &enum_state];
|
|
||||||
[collection release];
|
|
||||||
/* xxx
|
|
||||||
* I don't understand this - but calling [super dealloc] screws up
|
|
||||||
* so we use NSDeallocateObject() instead.
|
|
||||||
*/
|
|
||||||
NSDeallocateObject(self);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ConstantKeyedCollection
|
@implementation ConstantKeyedCollection
|
||||||
|
|
|
@ -311,8 +311,9 @@ static NSLock* cache_lock = nil;
|
||||||
{
|
{
|
||||||
int i, length;
|
int i, length;
|
||||||
char *bytes;
|
char *bytes;
|
||||||
NSMutableData *bitmap = [[self bitmapRepresentation] mutableCopy];
|
NSMutableData *bitmap;
|
||||||
|
|
||||||
|
bitmap = [[[self bitmapRepresentation] mutableCopy] autorelease];
|
||||||
length = [bitmap length];
|
length = [bitmap length];
|
||||||
bytes = [bitmap mutableBytes];
|
bytes = [bitmap mutableBytes];
|
||||||
for (i=0; i < length; i++)
|
for (i=0; i < length; i++)
|
||||||
|
|
|
@ -774,6 +774,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len)
|
||||||
autorelease];
|
autorelease];
|
||||||
#else
|
#else
|
||||||
return [[[NSDataMalloc alloc] initWithBytes:bytes length:length]
|
return [[[NSDataMalloc alloc] initWithBytes:bytes length:length]
|
||||||
|
autorelease];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -427,6 +427,8 @@ handle_printf_atsign (FILE *stream,
|
||||||
}
|
}
|
||||||
/* Get a C-string (char*) from the String object, and print it. */
|
/* Get a C-string (char*) from the String object, and print it. */
|
||||||
cstring = [[(id) va_arg (arg_list, id) description] cStringNoCopy];
|
cstring = [[(id) va_arg (arg_list, id) description] cStringNoCopy];
|
||||||
|
if (!cstring)
|
||||||
|
cstring = "<null string>";
|
||||||
strcat (buf+printed_len, cstring);
|
strcat (buf+printed_len, cstring);
|
||||||
printed_len += strlen (cstring);
|
printed_len += strlen (cstring);
|
||||||
/* Skip over this `%@', and look for another one. */
|
/* Skip over this `%@', and look for another one. */
|
||||||
|
|
|
@ -33,9 +33,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <objc/objc-api.h>
|
#include <objc/objc-api.h>
|
||||||
#include <objc/objc-list.h>
|
#include <objc/objc-list.h>
|
||||||
#ifdef HAVE_CONFIG_H
|
#include <config.h>
|
||||||
#include <gnustep/base/config.h>
|
|
||||||
#endif
|
|
||||||
#include <Foundation/objc-load.h>
|
#include <Foundation/objc-load.h>
|
||||||
|
|
||||||
/* include the interface to the dynamic linker */
|
/* include the interface to the dynamic linker */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue