Skip to content

Leak with using weak NSThread in thread #5

Description

@newacct

On profiling an app with the following code, running on iOS 4.3 simulator with PLWeakCompatibility, I am getting a leak in the Leaks instrument, saying that the struct TLS (as well as the dictionaries inside it) created in GetTLS are leaked.

Is this a bug with PLWeakCompatibility, or am I doing something wrong?

- (void)foo {
  @autoreleasepool {
    NSThread* __weak myThread = [NSThread currentThread];
    [myThread self];
  }
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [NSThread detachNewThreadSelector:@selector(foo) toTarget:self withObject:nil];
  return YES;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions