Skip to content

Commit

Permalink
fix for multi forget with the file info
Browse files Browse the repository at this point in the history
  • Loading branch information
EricTheMagician committed Nov 14, 2015
1 parent e53d791 commit 8c74920
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,16 +524,16 @@ namespace NodeFuse {
Local<Object> context = RequestContextToObject(fuse_req_ctx(req))->ToObject();
Local<Array> data = Nan::New<Array>(count);

// for( uint i = 0; i < count; i++){
ForgetData *forget_data = new ForgetData();
// forget_data->fd = &( forget_all[i] );
Local<Object> infoObj = Nan::NewInstance(Nan::New<Function>(FileInfo::constructor)).ToLocalChecked(); //Nan::NewInstance(Nan::New<Function>(forget_data->constructor)).ToLocalChecked();//->GetFunction()->NewInstance();
FileInfo *data = Nan::ObjectWrap.Unwrap(i, infoObj);
info->fi = fi;
for( uint i = 0; i < count; i++){
// ForgetData *forget_data = new ForgetData();
// forget_data->fd = &( forget_all[i] );
Local<Object> forgetObject = Nan::NewInstance(Nan::New<Function>(FileInfo::constructor)).ToLocalChecked(); //Nan::NewInstance(Nan::New<Function>(forget_data->constructor)).ToLocalChecked();//->GetFunction()->NewInstance();
ForgetData *forget_data = Nan::ObjectWrap::Unwrap<ForgetData>(forgetObject);
forget_data->fd = &( forget_all[i] );
data->Set(i, forgetObject);
}

Local<Object> replyObj = Nan::NewInstance( Nan::New<Function>(Reply::constructor)).ToLocalChecked();//->GetFunction()->NewInstance();

Reply *reply = Nan::ObjectWrap::Unwrap<Reply>(replyObj);
reply->request = req;
Local<Value> argv[3] = {context, data, replyObj};
Expand Down

0 comments on commit 8c74920

Please sign in to comment.