From 1e23af2adc9f489bafcd09dfc97795b4f9d5bb6f Mon Sep 17 00:00:00 2001 From: tqchen Date: Sat, 14 Mar 2015 00:20:37 -0700 Subject: [PATCH] add virtual destructor to iseekstream --- include/rabit/io.h | 2 ++ rabit-learn/io/hdfs-inl.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/rabit/io.h b/include/rabit/io.h index 307f67f0f..eb1ca4414 100644 --- a/include/rabit/io.h +++ b/include/rabit/io.h @@ -19,6 +19,8 @@ namespace utils { /*! \brief interface of i/o stream that support seek */ class ISeekStream: public IStream { public: + // virtual destructor + virtual ~ISeekStream(void) {} /*! \brief seek to certain position of the file */ virtual void Seek(size_t pos) = 0; /*! \brief tell the position of the stream */ diff --git a/rabit-learn/io/hdfs-inl.h b/rabit-learn/io/hdfs-inl.h index 526580020..7fcbec8d5 100644 --- a/rabit-learn/io/hdfs-inl.h +++ b/rabit-learn/io/hdfs-inl.h @@ -23,7 +23,7 @@ class HDFSStream : public utils::ISeekStream { bool disconnect_when_done) : fs_(fs), at_end_(false), disconnect_when_done_(disconnect_when_done) { - int flag; + int flag = 0; if (!strcmp(mode, "r")) { flag = O_RDONLY; } else if (!strcmp(mode, "w")) {