Fix test GSCellFlags.

Make NSBezierPath -dealloc a bit saver.
This commit is contained in:
Fred Kiefer 2024-11-15 22:10:29 +01:00
parent c89d7432a4
commit 87e132ca82
2 changed files with 8 additions and 11 deletions

View file

@ -287,8 +287,11 @@ static CGFloat default_miter_limit = 10.0;
- (void) dealloc
{
GSIArrayEmpty(_pathElements);
NSZoneFree([self zone], _pathElements);
if (_pathElements != NULL)
{
GSIArrayEmpty(_pathElements);
NSZoneFree([self zone], _pathElements);
}
if (_cacheImage != nil)
RELEASE(_cacheImage);

View file

@ -21,20 +21,14 @@ int main()
mask.flags.useUserKeyEquivalent = 1;
mask.flags.truncateLastLine = 1;
#if GS_WORDS_BIGENDIAN == 1
pass(mask.value == 0b00010010000000000001110000001001, "mask.flags translates to mask.value");
#else
pass(mask.value == 0b10010000001110000000000001001000, "mask.flags translates to mask.value");
#endif
// reset mask
mask.value = 0;
mask.flags = (GSCellFlags){0};
// now make sure values translate to flags
#if GS_WORDS_BIGENDIAN == 1
mask.value = 0b00010010000000000001110000001001;
#else
mask.value = 0b10010000001110000000000001001000;
#endif
pass(mask.flags.state == 1, "state is correctly set");
pass(mask.flags.selectable == 1, "selectable is correctly set");
@ -48,4 +42,4 @@ int main()
DESTROY(arp);
return 0;
}
}