summaryrefslogtreecommitdiff
path: root/src/node_file.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-08-13 11:56:44 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-08-13 11:56:45 +0200
commitffc5d83568cc9ff694c6461aaa9dfc70545bf23c (patch)
treef7de886a0b3208d623e65b826cfd1a600df5ea8b /src/node_file.cc
parent4ac6912a778be5876cf1759bb46d7e03f82784d8 (diff)
downloadnode-ffc5d83568cc9ff694c6461aaa9dfc70545bf23c.tar.gz
src: move ReqWrap::data_ to FSReqWrap
FSReqWrap is the only ReqWrap child class that uses the data_ field so move it out of ReqWrap and into FSReqWrap.
Diffstat (limited to 'src/node_file.cc')
-rw-r--r--src/node_file.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/node_file.cc b/src/node_file.cc
index e01c5bd67..856661f7c 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -64,12 +64,14 @@ using v8::Value;
class FSReqWrap: public ReqWrap<uv_fs_t> {
public:
explicit FSReqWrap(const char* syscall)
- : must_free_(false),
- syscall_(syscall) {
+ : must_free_(false)
+ , data_(NULL)
+ , syscall_(syscall) {
}
const char* syscall() { return syscall_; }
bool must_free_; // request is responsible for free'ing memory oncomplete
+ char* data_;
private:
const char* syscall_;
@@ -103,7 +105,7 @@ static void After(uv_fs_t *req) {
// check if data needs to be cleaned
if (req_wrap->must_free_ == true)
- delete[] static_cast<char*>(req_wrap->data_);
+ delete[] req_wrap->data_;
// there is always at least one argument. "error"
int argc = 1;