Skip to content

Creating non-pointer agent object can cause double free error #56

@ginoscott

Description

@ginoscott

When an Agent object is created as a non-pointer object, i.e.,:

Agent agent(...)

as opposed to:

Agent* agent = new Agent(...)

If shutdown() is called within the Agent object, then when the scope containing the agent object is left and it is destroyed, then the destructor will also call shutdown() and cause internal pointers to be freed again, resulting in error messages like this:

[0.009] Shutting down Agent. Last error: Open
free(): double free detected in tcache 2

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