Release objects

This commit is contained in:
Gregory John Casamento 2019-06-10 11:02:48 -04:00
parent 30aea6e5ad
commit d66ad25b50

View file

@ -382,15 +382,14 @@ static SEL rlSel;
- (instancetype) initWithArray:(NSArray *)other copyItems:(BOOL)flag
{
unsigned count = [other count];
unsigned j = count;
if (count == 0)
{
return [self init];
}
else
{
GS_BEGINIDBUF(objs, count);
GS_BEGINIDBUF(objs, count);
{
unsigned i;
@ -408,9 +407,16 @@ static SEL rlSel;
}
self = [self initWithObjects: objs count: count];
if(flag == YES)
{
while(j--)
{
[objs[j] release];
}
}
GS_ENDIDBUF();
return self;
}
}
- (instancetype) initWithArray:(NSArray *)other
@ -418,6 +424,7 @@ static SEL rlSel;
copyItems:(BOOL)flag
{
unsigned count = [other count];
unsigned i = 0, j = 0;
if (count == 0)
{
@ -426,10 +433,8 @@ static SEL rlSel;
GS_BEGINIDBUF(objs, range.length);
{
unsigned i = 0;
unsigned loc = range.location;
unsigned len = range.length;
unsigned j = 0;
for (i = 0; i < count; i++)
{
@ -453,6 +458,14 @@ static SEL rlSel;
}
}
self = [self initWithObjects: objs count: count];
if(flag == YES)
{
while(j--)
{
[objs[j] release];
}
}
GS_ENDIDBUF();
return self;