How to release NSThread object thoroughly?

79 views Asked by At

Like this title, I want know how to release NSThread object thoroughly.

This is my code:

for(int i = 0; i < 10; i++){
  NSThread * thread = [[NSThread alloc] initWithBlock:^{
    @autoreleasepool {
      sleep(3);
      NSLog(@"ended");
    }
  }];
  thread.name = @"asdf";
  [thread start];
}

thread will be released after execution. But "Instruments" tells me that thread still has 512kb of space in memory, and that the method is [thread start].

Instruments output

Can I release this space, and if so, how?

0

There are 0 answers