]> git.tdb.fi Git - libs/core.git/commitdiff
Disallow closing stuff before destruction
authorMikko Rasa <tdb@tdb.fi>
Tue, 14 Jun 2011 07:19:09 +0000 (10:19 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 14 Jun 2011 07:19:09 +0000 (10:19 +0300)
source/io/file.cpp
source/io/file.h
source/io/pipe.cpp
source/io/pipe.h

index 0f5652ad9484cf460a2e266f666470c00b67dd02..a91a927fbc4ac5b5c76ba65fcaa341a8571b6e99 100644 (file)
@@ -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();
 }
 
index ee83554cff806bc4ba47d0e1383cbcb426b5f153..cd547b37545cb23b6f0c3842c512a7cf13847905 100644 (file)
@@ -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:
index f52801cd834e550199a808ab99020adcac8d6a27..2e37f119aeaf3dc67726341d2047cc30748044d3 100644 (file)
@@ -41,11 +41,6 @@ Pipe::Pipe():
 }
 
 Pipe::~Pipe()
-{
-       close();
-}
-
-void Pipe::close()
 {
        set_events(P_NONE);
 
index 813c4d8e6c634047c07b70830b8a196e5252df43..73731776856a2fc1c9d90530935fc4009ffaf2cc 100644 (file)
@@ -18,8 +18,6 @@ public:
        Pipe();
        ~Pipe();
 
-       void close();
-
        void set_block(bool);
 
 protected: