Skip to content

Leaking memory? #21

@Dr4k3z

Description

@Dr4k3z

The custom deleter lambda function is not actually deleting the object.

auto up_deleter = [fileName](Object* i_obj){ i_obj->dumpToFile(fileName); };

Isn't this leaking memory? I guess the correct version should be

auto deleter = [fileName](Object* ptr){
            ptr->dumpToFile(fileName);
            delete ptr;
};

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