quakeforge/ruamoko/cl_menu/CvarObject.r
Bill Currie 8385046486 [qfcc] Warn when super dealloc invocation is missing
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 :)
2021-12-24 22:45:43 +09:00

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