Skip to content

Instantly share code, notes, and snippets.

@pagameba
Created November 22, 2010 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pagameba/710009 to your computer and use it in GitHub Desktop.
Save pagameba/710009 to your computer and use it in GitHub Desktop.
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];
argv[0] = Local<Value>::New(Null());
if (drawmap_req->data != NULL) {
Buffer * buffer = Buffer::New(drawmap_req->data, drawmap_req->size, FreeImageBuffer, NULL);
argv[1] = scope.Close(buffer->handle_);
} else {
argv[0] = Integer::New(1);
// TODO: how to return the msErrorObj here?
errorObj * err = msGetErrorObj();
Local<Value> _arg_ = External::New(err);
Persistent<Object> _err_(ErrorObj::constructor_template->GetFunction()->NewInstance(1, &_arg_));
argv[0] = Local<Value>::New(_err_);
// argv[0] = Integer::New(1);
}
TryCatch try_catch;
drawmap_req->cb->Call(Context::GetCurrent()->Global(), 1, argv);
if (try_catch.HasCaught()) {
FatalException(try_catch);
}
drawmap_req->cb.Dispose();
delete drawmap_req;
return 0;
}
@pagameba
Copy link
Author

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000030
0x0000000100119e17 in v8::internal::JSObject::GetElementWithReceiver ()
(gdb) bt
#0 0x0000000100119e17 in v8::internal::JSObject::GetElementWithReceiver ()
#1 0x0000000100181835 in v8::internal::Runtime::GetObjectProperty ()

Previous frame inner to this frame (gdb could not unwind past this frame)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment