Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure buffer is deallocated in render

  • Loading branch information...
commit 6fbb4cdb3f7d95620a63d5c1bf4fed030517b0a8 1 parent cc2e2ba
@jmendeth jmendeth authored
Showing with 5 additions and 7 deletions.
  1. +1 −1  package.json
  2. +4 −6 src/robotskirt.cc
View
2  package.json
@@ -2,7 +2,7 @@
, "description": "A node wrapper for the awesome C markdown parsing library, sundown."
, "tags": ["sundown", "upskirt", "robot", "markdown", "mkd"]
, "author" : "Ben Mills <ben@bmdev.org>"
-, "version": "2.1.2"
+, "version": "2.1.3"
, "lib": "./build/Release"
, "main": "./index.js"
, "scripts": { "publish": "node-waf configure build" }
View
10 src/robotskirt.cc
@@ -434,18 +434,16 @@ class Markdown: public ObjectWrap {
length = Buffer::Length(obj);
//Prepare
- buf* out = bufnew(OUTPUT_UNIT); //XXX TODO: ensure deallocation
+ BufWrap out (bufnew(OUTPUT_UNIT));
//GO!!
- sd_markdown_render(out, (uint8_t*)data, length, md->markdown);
+ sd_markdown_render(*out, (uint8_t*)data, length, md->markdown);
- //Finish and...
+ //Finish
Buffer* buffer = Buffer::New((char*)out->data, out->size);
Local<Object> fastBuffer;
MAKE_FAST_BUFFER(buffer, fastBuffer);
out->data = NULL;
- //...cleanup
- bufrelease(out);
return scope.Close(fastBuffer);
} V8_WRAP_END()
@@ -702,7 +700,7 @@ extern "C" {
target->Set(String::NewSymbol("markdownVersion"), mv->GetFunction());
//Robotskirt version
- target->Set(String::NewSymbol("version"), newVersionInstance(ver->GetFunction(), 2,1,1 ));
+ target->Set(String::NewSymbol("version"), newVersionInstance(ver->GetFunction(), 2,1,3 ));
//RENDERER class
Persistent<FunctionTemplate> rend = initRenderer(target);
Please sign in to comment.
Something went wrong with that request. Please try again.