Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B Bolts-ObjC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 34
    • Issues 34
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • BoltsFramework
  • Bolts-ObjC
  • Issues
  • #249
Closed
Open
Issue created May 19, 2016 by Administrator@root

Memory leak?

Created by: rgurzhiy

I've made a simple OSX application:

AppDelegate.m

#import "AppDelegate.h"
#import <Bolts/Bolts.h>

@interface AppDelegate ()
@property (weak) IBOutlet NSWindow *window;
@end

@implementation AppDelegate

- (IBAction) test:(id)sender {
    [[self testAsync] continueWithBlock:^id (BFTask *task) {
        NSLog(@"%@", task.result);
        return nil;
    }];
}

- (BFTask *) testAsync {
    BFTaskCompletionSource *completionSource = [BFTaskCompletionSource taskCompletionSource];

    [[BFTask taskWithDelay:1000] continueWithBlock:^id (BFTask *task) {
        [completionSource setResult:[NSDate date]];
        return nil;
    }];

    return completionSource.task;
}

@end

When I run it with Allocations instrument, I get the trace BoltsMemory.trace.zip

Almost every time - (IBAction) test:(id)sender is being executed new allocations are added to the trace and stay Live forever. screen shot 2016-05-19 at 6 48 32 pm As you can see responsible caller is -[BFTask trySetResult:] screen shot 2016-05-19 at 6 51 57 pm or -[BFTask continueWithExecutor:block:cancellationToken:] screen shot 2016-05-19 at 6 52 40 pm

Can it be considered as memory leak?

Assignee
Assign to
Time tracking