src: fix mismatched delete[] in src/node_file.cc
authorBen Noordhuis <info@bnoordhuis.nl>
Sat, 7 Mar 2015 17:24:27 +0000 (18:24 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Sat, 7 Mar 2015 18:37:14 +0000 (19:37 +0100)
commit648fc63cd1627cbb256e363a9ec2a12cc709b9cb
tree1199a5725cbd36baefdf54615c501dd51347dac0
parent0f7c8ebeea26f68cae8abff254248e893dab9f8f
src: fix mismatched delete[] in src/node_file.cc

Fix a bad delete of a pointer that was allocated with placement new.
Casting the pointer was not the right solution because there was at
least one non-placement new constructor call.

This commit rewrites FSReqWrap to be more explicit about ownership of
the auxiliary data and removes a number of egregious const_casts.
The ASYNC_DEST_CALL macro also gets significantly slimmed down.

PR-URL: https://github.com/iojs/io.js/pull/1092
Reviewed-By: Fedor Indutny <fedor@indutny.com>
src/node_file.cc