From 3c3417fabed7693a391860206faf25e27df67db4 Mon Sep 17 00:00:00 2001 From: hmelder Date: Sat, 27 Apr 2024 15:39:16 +0200 Subject: [PATCH] Remove Windows Include and correctly release thread obj --- Tests/base/NSThread/name.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/base/NSThread/name.m b/Tests/base/NSThread/name.m index 48a275e79..1e8687192 100644 --- a/Tests/base/NSThread/name.m +++ b/Tests/base/NSThread/name.m @@ -1,5 +1,4 @@ #import "ObjectTesting.h" -#include #import #if defined(_WIN32) && (NTDDI_VERSION >= NTDDI_WIN10_RS1) @@ -19,11 +18,12 @@ int main(void) HRESULT hr = SetThreadDescription(current, L"Test"); PASS(SUCCEEDED(hr), "SetThreadDescription was successful"); - NSString *name = [[[NSThread alloc] init] name]; + NSThread *thread = [[NSThread alloc] init]; + NSString *name = [thread name]; PASS(name != nil, "-[NSThread name] returns a valid string"); NSLog(@"Name: %@", name); PASS([name isEqualToString: @"Test"], "Thread name is correct"); - [name release]; + [thread release]; [[NSThread currentThread] setName: @"Test2"]; name = [[NSThread currentThread] name];