Skip to content

Commit 3c6af97

Browse files
authored
Merge pull request #346 from sjanuary/headless
Fix for #345 - headless fails on windows
2 parents 69eaa6e + 4186b42 commit 3c6af97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/headlessutils.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "headlessutils.h"
1919
#include <iostream>
20+
#include <string>
2021
#include "nan.h"
2122
#include "uv.h"
2223

@@ -31,12 +32,12 @@ void setZipFunction(Nan::Callback* zF) {
3132
uv_async_t async_zip;
3233

3334
uv_loop_t* loop;
34-
const char* outputDir;
35+
std::string outputDir;
3536

3637
void asyncfunc(uv_async_t* handle) {
3738
Nan::HandleScope scope;
3839
v8::Isolate* isolate = v8::Isolate::GetCurrent();
39-
v8::Local<v8::Value> argv[] = { v8::String::NewFromUtf8(isolate, outputDir) };
40+
v8::Local<v8::Value> argv[] = { v8::String::NewFromUtf8(isolate, outputDir.c_str()) };
4041
headless::zipFunction->Call(1, argv);
4142
}
4243

@@ -53,7 +54,7 @@ void stop() {
5354
}
5455

5556
void zip(const char* dir) {
56-
outputDir = dir;
57+
outputDir = std::string(dir);
5758
uv_async_send(&async_zip);
5859
}
5960

0 commit comments

Comments
 (0)