diff --git a/Source/NSBezierPath.m b/Source/NSBezierPath.m index 5065928c7..f457c0586 100644 --- a/Source/NSBezierPath.m +++ b/Source/NSBezierPath.m @@ -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); diff --git a/Tests/gui/GSCodingFlags/GSCellFlags.m b/Tests/gui/GSCodingFlags/GSCellFlags.m index 9279b5599..d235a0769 100644 --- a/Tests/gui/GSCodingFlags/GSCellFlags.m +++ b/Tests/gui/GSCodingFlags/GSCellFlags.m @@ -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; -} \ No newline at end of file +}