Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-1630] Memory leak when creating Swift object in Objective-C code #44239

Open
swift-ci opened this issue May 27, 2016 · 1 comment
Open

[SR-1630] Memory leak when creating Swift object in Objective-C code #44239

swift-ci opened this issue May 27, 2016 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself memory leak bug: Memory leak runtime The Swift Runtime

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-1630
Radar None
Original Reporter michal.b (JIRA User)
Type Bug

Attachment: Download

Environment

Xcode Version 7.3.1 (7D1014)
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)

Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Bug, Leak, Runtime
Assignee None
Priority Medium

md5: a063b3e50a125bb10089bd28bd32897c

Issue Description:

Instruments mark this as memory leak:

- (NSArray *)fetchModelsCount:(NSUInteger)count {
    NSMutableArray *arr = [NSMutableArray new];

    for (int i = 0; i < count; i++) {
        NSString *modelName = [NSString stringWithFormat:@"#%i Dummy swift model name.", i+1];
        DummySwiftModel *model = [[DummySwiftModel alloc] initWithName:modelName];
        [arr addObject:model];
    }

    return [arr copy];
}

DummySwiftModel is Swift class.

Example project attached.

@swift-ci
Copy link
Collaborator Author

Comment by Fabio Mignogna (JIRA)

Hi guys,

any news about this memory leak? Any workaround?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself memory leak bug: Memory leak runtime The Swift Runtime
Projects
None yet
Development

No branches or pull requests

1 participant