mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
fix some leak issues
This commit is contained in:
parent
68e7b3199d
commit
809ce1fb82
1 changed files with 5 additions and 2 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue