diff --git a/efel/cppcore/eFELLogger.h b/efel/cppcore/eFELLogger.h index a02ab106..cd6a0b27 100644 --- a/efel/cppcore/eFELLogger.h +++ b/efel/cppcore/eFELLogger.h @@ -23,6 +23,7 @@ #include #include #include +#include class eFELLogger { @@ -37,6 +38,13 @@ class eFELLogger } } + ~eFELLogger() + { + if (logfile.is_open()) { + logfile.close(); + } + } + template eFELLogger &operator<<(const std::vector &v){ if(logging){ diff --git a/tests/test_cppcore.py b/tests/test_cppcore.py index d80b0b42..ef5131e6 100644 --- a/tests/test_cppcore.py +++ b/tests/test_cppcore.py @@ -200,6 +200,9 @@ def test_caching(self, feature_name): efel.cppcore.getFeature(feature_name, feature_values) with (Path(tempdir) / 'fllog.txt').open() as fd: contents = fd.read() + # re-call efel's Initialize with current dir to remove pointer to tempdir. + # this pointer was preventing the deletion of tempdir on windows. + efel.cppcore.Initialize(efel.getDependencyFileLocation(), '.') assert f"Calculated feature {feature_name}" in contents assert f"Reusing computed value of {feature_name}" in contents # make sure Calculated feature text occurs once