Skip to content

Leak with using weak NSThread in thread #5

@newacct

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions