Use release' and dealloc' instead of `free'.

(initialize): return void.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@98 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1995-03-12 19:46:34 +00:00
parent 3041551b0f
commit 65c2a03696
6 changed files with 34 additions and 62 deletions

View file

@ -25,9 +25,9 @@
@implementation DelegatePool
+ initialize
+ (void) initialize
{
return self;
return;
}
+ alloc
@ -85,13 +85,13 @@
}
- free
- (void) dealloc
{
[_list free];
[_list release];
#if NeXT_runtime
return (id) object_dispose((Object*)self);
object_dispose((Object*)self);
#else
return (id) object_dispose(self);
NSDeallocateObject((NSObject*)self);
#endif
}

View file

@ -28,11 +28,10 @@
@implementation Dictionary
+ initialize
+ (void) initialize
{
if (self == [Dictionary class])
[self setVersion:0]; /* beta release */
return self;
}
// MANAGING CAPACITY;
@ -143,22 +142,10 @@
capacity:aCapacity];
}
- free
- (void) dealloc
{
coll_hash_delete(_contents_hash);
return [super free];
}
- freeObjects
{
if (CONTAINS_OBJECTS)
{
[self makeObjectsPerform:@selector(free)];
[self empty];
}
else
[self empty];
return self;
[super dealloc];
}
/* This must work without sending any messages to content objects */

View file

@ -39,11 +39,10 @@
@implementation EltNodeCollector
+ initialize
+ (void) initialize
{
if (self == [EltNodeCollector class])
[self setVersion:0]; /* beta release */
return self;
}
+ defaultEltNodeClass
@ -186,10 +185,10 @@
nodeClass:[[self class] defaultEltNodeClass]];
}
- free
- (void) dealloc
{
[[_contents_collector freeObjects] free];
return [super free];
[[_contents_collector releaseObjects] release];
[super dealloc];
}
@ -290,7 +289,7 @@
CHECK_INDEX_RANGE_ERROR(index, [_contents_collector count]);
node = [_contents_collector removeElementAtIndex:index].id_u;
ret = [node elementData];
[node free];
[node release];
return ret;
}
@ -303,7 +302,7 @@
return ELEMENT_NOT_FOUND_ERROR(oldElement);
ret = [aNode elementData];
[_contents_collector removeElement:aNode];
[aNode free];
[aNode release];
return ret;
}
@ -316,7 +315,7 @@
return NO_ELEMENT_FOUND_ERROR();
ret = [aNode elementData];
[_contents_collector removeElement:aNode];
[aNode free];
[aNode release];
return ret;
}
@ -329,7 +328,7 @@
return NO_ELEMENT_FOUND_ERROR();
ret = [aNode elementData];
[_contents_collector removeElement:aNode];
[aNode free];
[aNode release];
return ret;
}
@ -343,7 +342,7 @@
ret = [aNode elementData];
[_contents_collector replaceElement:aNode
with:[self makeEltNodeWithElement:newElement]];
[aNode free];
[aNode release];
return ret;
}
@ -357,7 +356,7 @@
replaceElementAtIndex:index
with:[self makeEltNodeWithElement:newElement]];
ret = [oldNode.id_u elementData];
[oldNode.id_u free];
[oldNode.id_u release];
return ret;
}

View file

@ -28,11 +28,10 @@
@implementation IndexedCollection
+ initialize
+ (void) initialize
{
if (self == [IndexedCollection class])
[self setVersion:0]; /* beta release */
return self;
}
/* This is the designated initializer of this class */
@ -173,7 +172,7 @@
{
/* Can I assume that all Collections will inherit from Object? */
if ([aCollection
respondsTo:@selector(withElementsInReverseCall:)])
respondsToSelector:@selector(withElementsInReverseCall:)])
[(id)aCollection withElementsInReverseCall:doIt];
else
[aCollection withElementsCall:doIt];
@ -197,7 +196,8 @@
[self safeWithElementsInReverseCall:doIt];
else
{
if ([aCollection respondsTo:@selector(withElemetnsInReverseCall:)])
if ([aCollection respondsToSelector:
@selector(withElemetnsInReverseCall:)])
[(id)aCollection withElementsInReverseCall:doIt];
else
[aCollection withElementsCall:doIt];
@ -681,7 +681,7 @@
for (i = aRange.start; i < aRange.end && i < myCount; i++)
[tmpColl addElement:[self elementAtIndex:i]];
[tmpColl withElementsCall:aFunc];
[tmpColl free];
[tmpColl release];
return self;
}
@ -822,7 +822,7 @@
{
id tmp = [[Array alloc] initWithContentsOf:self];
[tmp withElementsInReverseCall:aFunc whileTrue:flag];
[tmp free];
[tmp release];
return self;
}

View file

@ -28,11 +28,10 @@
@implementation KeyedCollection
+ initialize
+ (void) initialize
{
if (self == [KeyedCollection class])
[self setVersion:0]; /* beta release */
return self;
}
@ -65,10 +64,10 @@
keyType:@encode(id)];
}
- free
- (void) dealloc
{
// ?? ;
return [super free];
[super dealloc];
}
@ -237,7 +236,7 @@
content, key);
}
if ([aCollectionClass conformsTo:@protocol(KeyedCollecting)])
if ([aCollectionClass conformsToProtocol:@protocol(KeyedCollecting)])
{
newColl = [self emptyCopyAs:aCollectionClass];
putElementAtKeyImp = (id(*)(id,SEL,elt,elt))
@ -286,7 +285,7 @@
}
[self withKeyElementsAndContentElementsCall:addKey];
[tmpColl withElementsCall:aFunc];
[tmpColl free];
[tmpColl release];
return self;
}
@ -404,8 +403,8 @@
[self withKeyElementsAndContentElementsCall:appendKeyAndContent];
for (i = 0; *flag && i < count; i++)
(*aFunc)([keyTmpColl elementAtIndex:i], [contentTmpColl elementAtIndex:i]);
[keyTmpColl free];
[contentTmpColl free];
[keyTmpColl release];
[contentTmpColl release];
return self;
}

View file

@ -36,12 +36,6 @@
@implementation RetainingNotifier
+ initialize
{
/* What goes here? */
return self;
}
- init
{
retain_count = 0;
@ -53,10 +47,9 @@
- (void) dealloc
{
[refGate free];
[refGate release];
[notificationList free];
[super free];
return;
[super dealloc];
}
- (oneway void) release
@ -80,12 +73,6 @@
return self;
}
- free
{
[self release];
return nil;
}
- (unsigned) retainCount
{
return retain_count;