destroy buffers.

This commit is contained in:
Christopher Jeffrey 2016-03-15 15:05:58 -07:00
parent e31a4527b4
commit f5142046a9

View File

@ -22,7 +22,7 @@ function BufferWriter(options) {
this.written = 0;
}
BufferWriter.prototype.render = function render() {
BufferWriter.prototype.render = function render(keep) {
var data = new Buffer(this.written);
var off = 0;
var i, item;
@ -49,6 +49,9 @@ BufferWriter.prototype.render = function render() {
}
}
if (keep !== true)
this.destroy();
return data;
};