From: Mikko Rasa Date: Tue, 14 Jun 2011 07:19:09 +0000 (+0300) Subject: Disallow closing stuff before destruction X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e4afb5edb0b7834ef4872218c99207e6b589e9ce;p=libs%2Fcore.git Disallow closing stuff before destruction --- diff --git a/source/io/file.cpp b/source/io/file.cpp index 0f5652a..a91a927 100644 --- a/source/io/file.cpp +++ b/source/io/file.cpp @@ -86,19 +86,8 @@ File::File(const string &fn, Mode m, CreateMode cm) File::~File() { - close(); -} - -void File::close() -{ - if(!handle) - return; - signal_flush_required.emit(); - sys_close(handle); - - handle = Handle(); signal_closed.emit(); } diff --git a/source/io/file.h b/source/io/file.h index ee83554..cd547b3 100644 --- a/source/io/file.h +++ b/source/io/file.h @@ -43,10 +43,6 @@ public: File(const std::string &, Mode = M_READ, CreateMode = CreateMode(C_CREATE+C_TRUNCATE)); virtual ~File(); - /** Closes the file. Any attempt to access the file after this will cause - an exception to be thrown. */ - void close(); - void set_block(bool); protected: diff --git a/source/io/pipe.cpp b/source/io/pipe.cpp index f52801c..2e37f11 100644 --- a/source/io/pipe.cpp +++ b/source/io/pipe.cpp @@ -41,11 +41,6 @@ Pipe::Pipe(): } Pipe::~Pipe() -{ - close(); -} - -void Pipe::close() { set_events(P_NONE); diff --git a/source/io/pipe.h b/source/io/pipe.h index 813c4d8..7373177 100644 --- a/source/io/pipe.h +++ b/source/io/pipe.h @@ -18,8 +18,6 @@ public: Pipe(); ~Pipe(); - void close(); - void set_block(bool); protected: