diff options
Diffstat (limited to 'tikzit/src/common/GraphElementProperty.m')
-rw-r--r-- | tikzit/src/common/GraphElementProperty.m | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tikzit/src/common/GraphElementProperty.m b/tikzit/src/common/GraphElementProperty.m index 5a19ace..3cf6632 100644 --- a/tikzit/src/common/GraphElementProperty.m +++ b/tikzit/src/common/GraphElementProperty.m @@ -41,9 +41,7 @@ self = [super init]; if (self) { [self setKey:n]; - [self setValue:nil]; isAtom = YES; - isKeyMatch = NO; } return self; } @@ -53,8 +51,6 @@ if (self) { [self setKey:k]; [self setValue:v]; - isAtom = NO; - isKeyMatch = NO; } return self; } @@ -63,13 +59,17 @@ self = [super init]; if (self) { [self setKey:k]; - [self setValue:nil]; - isAtom = NO; isKeyMatch = YES; } return self; } +- (void) dealloc { + [key release]; + [value release]; + [super dealloc]; +} + - (void)setValue:(NSString *)v { if (value != v) { [value release]; @@ -87,11 +87,12 @@ - (void)setKey:(NSString *)k { - if (k == nil) k = @""; // don't allow nil keys if (key != k) { [key release]; - key = [k retain]; + key = [k copy]; } + if (key == nil) + key = @""; // don't allow nil keys } - (NSString*)key { |