aboutsummaryrefslogtreecommitdiffhomepage
path: root/io.cpp
diff options
context:
space:
mode:
authorGravatar Cheer Xiao <xiaqqaix@gmail.com>2013-01-15 17:02:46 +0800
committerGravatar Cheer Xiao <xiaqqaix@gmail.com>2013-01-17 15:55:05 +0800
commit0f443ef37b21bdc7d97db394842055f7b6e755a6 (patch)
treea2102b6ab46bd6f1f312322a386c6a9a2934ddf5 /io.cpp
parenta20e0b9e2eb25b16e8416ac7758c2da0216dc6d8 (diff)
Convert io_buffer_destroy to ~io_buffer_t
Diffstat (limited to 'io.cpp')
-rw-r--r--io.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/io.cpp b/io.cpp
index 37ca25a1..6970a1c9 100644
--- a/io.cpp
+++ b/io.cpp
@@ -161,19 +161,19 @@ io_buffer_t *io_buffer_create(bool is_input)
return buffer_redirect;
}
-void io_buffer_destroy(const shared_ptr<io_buffer_t> &io_buffer)
+io_buffer_t::~io_buffer_t()
{
/**
If this is an input buffer, then io_read_buffer will not have
been called, and we need to close the output fd as well.
*/
- if (io_buffer->is_input)
+ if (is_input)
{
- exec_close(io_buffer->param1.pipe_fd[1]);
+ exec_close(param1.pipe_fd[1]);
}
- exec_close(io_buffer->param1.pipe_fd[0]);
+ exec_close(param1.pipe_fd[0]);
/*
Dont free fd for writing. This should already be free'd before