From ffc5d83568cc9ff694c6461aaa9dfc70545bf23c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 13 Aug 2013 11:56:44 +0200 Subject: 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. --- src/node_file.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/node_file.cc') 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 { 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(req_wrap->data_); + delete[] req_wrap->data_; // there is always at least one argument. "error" int argc = 1; -- cgit v1.2.1