-
-
Save stephank/710033 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int EIO_AfterDrawMap(eio_req *req) { | |
HandleScope scope; | |
drawmap_request *drawmap_req =(drawmap_request *)req->data; | |
ev_unref(EV_DEFAULT_UC); | |
drawmap_req->map->Unref(); | |
Local<Value> argv[2]; | |
if (drawmap_req->data != NULL) { | |
Buffer * buffer = Buffer::New(drawmap_req->data, drawmap_req->size, FreeImageBuffer, NULL); | |
argv[0] = Local<Value>::New(Null()); | |
argv[1] = Local<Value>::New(buffer->handle_)); | |
} else { | |
errorObj * err = msGetErrorObj(); | |
Local<Value> _arg_ = External::New(err); | |
argv[0] = Local<Value>::New(ErrorObj::constructor_template->GetFunction()->NewInstance(1, &_arg_)); | |
argv[1] = Local<Value>::New(Null()); | |
} | |
TryCatch try_catch; | |
drawmap_req->cb->Call(Context::GetCurrent()->Global(), 2, argv); | |
if (try_catch.HasCaught()) { | |
FatalException(try_catch); | |
} | |
drawmap_req->cb.Dispose(); | |
delete drawmap_req; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
moved TryCatch to before if, removed extraneous ) on line 12, get this in error case:
node(17393,0x7fff70132ca0) malloc: *** error for object 0x202020202020307: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap