summaryrefslogtreecommitdiffstats
path: root/src/OutputFile.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-07 09:40:06 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-07 09:40:06 +0100
commit0315433aef00644085d2278af405eaedbc184c5c (patch)
tree389d2de4eb025a851dc9c974cacc0d6b49c20a52 /src/OutputFile.h
parent37b4c4591d6835c4b88ded16286d6f4145aea367 (diff)
downloaddabmod-0315433aef00644085d2278af405eaedbc184c5c.tar.gz
dabmod-0315433aef00644085d2278af405eaedbc184c5c.tar.bz2
dabmod-0315433aef00644085d2278af405eaedbc184c5c.zip
use unique_ptr to handle FILE* in Log
Diffstat (limited to 'src/OutputFile.h')
-rw-r--r--src/OutputFile.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/OutputFile.h b/src/OutputFile.h
index 97fdcb7..a586921 100644
--- a/src/OutputFile.h
+++ b/src/OutputFile.h
@@ -39,14 +39,6 @@
#include <sys/types.h>
#include <memory>
-struct FILEDeleter {
- void operator()(FILE* fd) {
- if (fd) {
- fclose(fd);
- }
- }
-};
-
class OutputFile : public ModOutput, public ModMetadata
{
public:
@@ -65,6 +57,8 @@ protected:
EtiSource *myEtiSource = nullptr;
std::string myFilename;
+
+ struct FILEDeleter{ void operator()(FILE* fd){ if (fd) fclose(fd); }};
std::unique_ptr<FILE, FILEDeleter> myFile;
};