Skip to content

self.janitor:add(Janitor.new(), "destroy") memory leaks #83

Description

@wrello

Occurences of:

self.janitor:add(Janitor.new(), "destroy")

are memory leaks if once the inner janitor is destroyed it doesn't get removed from the outer janitor.

They need the following pattern:

local janitor, objectIndex = self.janitor:add(Janitor.new(), "destroy")
janitor:add(function()
    self.janitor:remove(objectIndex)
end)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions