Skip to content

Memory retain cycles #25

@PeterKeDer

Description

@PeterKeDer

Find and fix memory retain cycles where two (or more) Rc are pointing in a cycle, making them never released. This can be fixed by changing some Rc into Weak such that strong reference with Rc is only "one-way".

Examples:

  • A function owns the environment in which it is declared, and that environment also owns the function.

    For example

    {
        // Environment "A" owns foo
        fun foo() {
            // foo's closure references environment "A"
        }
    }
    // Both "A" and foo are not dropped

    Consider changing DoveFunction.closure from Rc to Weak.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions