Commit 6f45b2a8 by Dean Mao

fix segfaults

parent e9f8807a
...@@ -121,6 +121,7 @@ Handle<Value> Render(const Arguments& args) { ...@@ -121,6 +121,7 @@ Handle<Value> Render(const Arguments& args) {
ctx->options.include_paths = new char[strlen(*bstr)+1]; ctx->options.include_paths = new char[strlen(*bstr)+1];
strcpy(ctx->options.include_paths, *bstr); strcpy(ctx->options.include_paths, *bstr);
// ctx->options.output_style = SASS_STYLE_NESTED; // ctx->options.output_style = SASS_STYLE_NESTED;
ctx->options.image_path = new char[0];
ctx->options.output_style = args[4]->Int32Value(); ctx->options.output_style = args[4]->Int32Value();
ctx->options.source_comments = args[5]->Int32Value(); ctx->options.source_comments = args[5]->Int32Value();
ctx_w->ctx = ctx; ctx_w->ctx = ctx;
...@@ -147,6 +148,7 @@ Handle<Value> RenderSync(const Arguments& args) { ...@@ -147,6 +148,7 @@ Handle<Value> RenderSync(const Arguments& args) {
ctx->options.include_paths = new char[strlen(*bstr)+1]; ctx->options.include_paths = new char[strlen(*bstr)+1];
strcpy(ctx->options.include_paths, *bstr); strcpy(ctx->options.include_paths, *bstr);
ctx->options.output_style = args[2]->Int32Value(); ctx->options.output_style = args[2]->Int32Value();
ctx->options.image_path = new char[0];
ctx->options.source_comments = args[3]->Int32Value(); ctx->options.source_comments = args[3]->Int32Value();
sass_compile(ctx); sass_compile(ctx);
...@@ -227,6 +229,7 @@ Handle<Value> RenderFile(const Arguments& args) { ...@@ -227,6 +229,7 @@ Handle<Value> RenderFile(const Arguments& args) {
strcpy(ctx->options.include_paths, *bstr); strcpy(ctx->options.include_paths, *bstr);
// ctx->options.output_style = SASS_STYLE_NESTED; // ctx->options.output_style = SASS_STYLE_NESTED;
ctx->options.output_style = args[4]->Int32Value(); ctx->options.output_style = args[4]->Int32Value();
ctx->options.image_path = new char[0];
ctx->options.source_comments = args[5]->Int32Value(); ctx->options.source_comments = args[5]->Int32Value();
ctx_w->ctx = ctx; ctx_w->ctx = ctx;
ctx_w->callback = Persistent<Function>::New(callback); ctx_w->callback = Persistent<Function>::New(callback);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment