Skip to content

Instantly share code, notes, and snippets.

@pagameba
Created November 22, 2010 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pagameba/709438 to your computer and use it in GitHub Desktop.
Save pagameba/709438 to your computer and use it in GitHub Desktop.
static int EIO_AfterDrawMap(eio_req *req) {
HandleScope scope;
drawmap_request *baton =(drawmap_request *)req->data;
ev_unref(EV_DEFAULT_UC);
baton->map->Unref();
Local<Value> argv[1];
Buffer * buffer = Buffer::New(baton->data, baton->size, FreeImageBuffer, NULL);
argv[0] = buffer;
TryCatch try_catch;
baton->cb->Call(Context::GetCurrent()->Global(), 1, argv);
if (try_catch.HasCaught()) {
FatalException(try_catch);
}
baton->cb.Dispose();
delete baton;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment