mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Add dealloc
This commit is contained in:
parent
2fb2e3dd8d
commit
2c8692c379
1 changed files with 20 additions and 1 deletions
|
@ -35,6 +35,15 @@ static NSMutableArray *activeConstraints;
|
|||
|
||||
@implementation NSLayoutConstraint
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == [NSLayoutConstraint class])
|
||||
{
|
||||
[self setVersion: 1];
|
||||
activeConstraints = [NSMutableArray arrayWithCapacity: 10];
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSString *) _attributeToString: (NSLayoutAttribute)attr
|
||||
{
|
||||
NSString *name = nil;
|
||||
|
@ -197,7 +206,8 @@ static NSMutableArray *activeConstraints;
|
|||
metrics: (NSDictionary *)metrics
|
||||
views: (NSDictionary *)views
|
||||
{
|
||||
return nil;
|
||||
NSMutableArray *array = [NSMutableArray arrayWithCapacity: 10];
|
||||
return array;
|
||||
}
|
||||
|
||||
- (instancetype) initWithItem: (id)firstItem
|
||||
|
@ -367,6 +377,9 @@ static NSMutableArray *activeConstraints;
|
|||
_secondItem = [coder decodeObject];
|
||||
}
|
||||
}
|
||||
|
||||
[activeConstraints addObject: self];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -412,6 +425,12 @@ static NSMutableArray *activeConstraints;
|
|||
return constraint;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[activeConstraints removeObject: self];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@ <firstItem = %@, firstAttribute = %ld, relation = %ld, secondItem = %@, "
|
||||
|
|
Loading…
Reference in a new issue