fix some leak issues

This commit is contained in:
Bill Currie 2006-12-16 14:00:00 +00:00 committed by Jeff Teunissen
parent 68e7b3199d
commit 809ce1fb82

View file

@ -22,11 +22,14 @@ function PR_FindFunction (string func) = #0;
- (id) init
{
return [self initWithEntity: spawn ()];
self = [self initWithEntity: spawn ()];
[self own];
return self;
}
- (id) initWithEntity: (entity)e
{
self = [super init];
ent = e;
ent.@this = self;
return self;
@ -34,7 +37,7 @@ function PR_FindFunction (string func) = #0;
- (void) dealloc
{
if (own)
if (own && ent)
remove (ent);
[super dealloc];
}