mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
8385046486
Forgetting to invoke [super dealloc] in a derived class's -dealloc method has caused me to waste far too much time chasing down the resulting memory leaks and crashes. This is actually the main focus of issue #24, but I want to take care of multiple paths before I consider the issue to be done. However, as a bonus, four cases were found :)
25 lines
303 B
R
25 lines
303 B
R
#include "string.h"
|
|
|
|
#include "CvarObject.h"
|
|
|
|
@implementation CvarObject
|
|
-(id)init
|
|
{
|
|
self = [super init];
|
|
name = str_new ();
|
|
return self;
|
|
}
|
|
|
|
-(id)initWithCvar:(string)cvname
|
|
{
|
|
self = [self init];
|
|
str_copy (name, cvname);
|
|
return self;
|
|
}
|
|
|
|
-(void)dealloc
|
|
{
|
|
str_free (name);
|
|
[super dealloc];
|
|
}
|
|
@end
|