You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
One of the constructors in emp::DataFile doesn't take an std::ostream, instead it takes a filename string.
It then uses that string to create a new std::ostream pointer. However, this pointer (os) is never deleted. Since it's not an Empirical pointer, this is not detected in debug mode.
To Reproduce
The DataFile example (examples/data/DataFile.cpp) has this issue without any modifications.
Here's the valgrind command I used to show the issue:
Expected behavior
Removing the memory leak is the main priority.
Switching the os pointer to be an emp::Ptr would improve consistency with rest of codebase.
Destructor and copy/move constructors will likely need to be updated to accommodate issue (rule of five).
Toolchain (please complete the following information):
OS: Pop!_OS 21.04
Compiler: gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1)
Bug description
One of the constructors in
emp::DataFile
doesn't take anstd::ostream
, instead it takes a filename string.It then uses that string to create a new
std::ostream
pointer. However, this pointer (os
) is never deleted. Since it's not an Empirical pointer, this is not detected in debug mode.Relevant code (line 52 at time of writing):
To Reproduce
The DataFile example (
examples/data/DataFile.cpp
) has this issue without any modifications.Here's the valgrind command I used to show the issue:
Expected behavior
Removing the memory leak is the main priority.
Switching the
os
pointer to be anemp::Ptr
would improve consistency with rest of codebase.Destructor and copy/move constructors will likely need to be updated to accommodate issue (rule of five).
Toolchain (please complete the following information):
master
at 1fe7f90The text was updated successfully, but these errors were encountered: