Skip to content

Conversation

@JonathonMisiewicz
Copy link
Contributor

@JonathonMisiewicz JonathonMisiewicz commented Nov 10, 2021

Description

This PR fixes a memory leak which I inadvertently introduced myself when refactoring libdiis.

What I was trying to do was take heap memory and move it into the stack. You can't actually do that. So when I released my std::vector from the smart pointer and saved it to a class variable, the memory was not cleared on object delete because it was still heap memory and not stack memory. Mea culpa.

Checklist

  • Quick tests pass

Status

  • Ready for review
  • Ready for merge

@JonathonMisiewicz JonathonMisiewicz added the efficiency For issues about code in Psi needing a disturbing amount of time and/or memory. label Nov 10, 2021
Copy link
Member

@jturney jturney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to use std::move like you did. LGTM

@hokru hokru merged commit 8926da6 into psi4:master Nov 12, 2021
@loriab loriab added this to the Psi4 1.5 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

efficiency For issues about code in Psi needing a disturbing amount of time and/or memory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants