Skip to content

Commit

Permalink
Fix test GSCellFlags.
Browse files Browse the repository at this point in the history
Make NSBezierPath -dealloc a bit saver.
  • Loading branch information
fredkiefer committed Nov 15, 2024
1 parent c89d743 commit 87e132c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Source/NSBezierPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,11 @@ - (id) init

- (void) dealloc
{
GSIArrayEmpty(_pathElements);
NSZoneFree([self zone], _pathElements);
if (_pathElements != NULL)
{
GSIArrayEmpty(_pathElements);
NSZoneFree([self zone], _pathElements);
}

if (_cacheImage != nil)
RELEASE(_cacheImage);
Expand Down
12 changes: 3 additions & 9 deletions Tests/gui/GSCodingFlags/GSCellFlags.m
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -48,4 +42,4 @@ int main()

DESTROY(arp);
return 0;
}
}

0 comments on commit 87e132c

Please sign in to comment.