Skip to content

Memory leak when declaring chans at the bottom of functions #729

Closed
@eholk

Description

@eholk

The following program leaks c from main.

fn start(chan[chan[str]] c) {
    let port[str] p;

    p = port();
    c <| chan(p);
}

fn main() {
    let port[chan[str]] p = port();
    spawn start(chan(p));

    p |> c;
    auto c;
}

Interestingly, if you move the auto c; line above p |> c then the program works correctly.

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