From 2ee48ebe2198305279c3e33f9d9091141a41bcc3 Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 14 Nov 2024 17:01:13 +0000 Subject: [PATCH] Don't try to release object which may have been released already --- TestFramework/ObjectTesting.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TestFramework/ObjectTesting.h b/TestFramework/ObjectTesting.h index 6282f172..d903128a 100644 --- a/TestFramework/ObjectTesting.h +++ b/TestFramework/ObjectTesting.h @@ -94,15 +94,14 @@ static void test_alloc(NSString *CN) PASS_EXCEPTION([obj0 description], NSInvalidArgumentException, \ "raises NSInvalidArgumentException in description") \ \ - PASS_EXCEPTION(if([obj0 init]==nil)[NSException raise: NSInvalidArgumentException format: @""], \ + PASS_EXCEPTION(if((obj0=[obj0 init])==nil)[NSException raise: NSInvalidArgumentException format: @""], \ NSInvalidArgumentException, \ "returns nil or raises NSInvalidArgumentException in init") \ \ - PASS_EXCEPTION(if([theClass new]==nil)[NSException raise: NSInvalidArgumentException format: @""], \ + PASS_EXCEPTION(if((obj0=[theClass new])==nil)[NSException raise: NSInvalidArgumentException format: @""], \ NSInvalidArgumentException, \ "returns nil or raises NSInvalidArgumentException in new") \ \ - DESTROY(obj0); \ obj1 = [theClass allocWithZone: testZone]; \ PASS([obj1 isKindOfClass: theClass],"%s has working allocWithZone",prefix); \ DESTROY(obj1); \