NanAssignPersistent source in NodeMap constructor, fixes #109

This commit is contained in:
Mike Morris
2015-04-03 15:43:40 -04:00
parent 186fbad236
commit ca0da9626e

View File

@@ -287,12 +287,13 @@ void NodeMap::renderFinished() {
// Instance
NodeMap::NodeMap(v8::Handle<v8::Object> source_) :
source(source_),
view(sharedDisplay()),
fs(*ObjectWrap::Unwrap<NodeFileSource>(source_)),
map(view, fs, mbgl::Map::RenderMode::Still),
async(new uv_async_t) {
NanAssignPersistent(source, source_);
async->data = this;
uv_async_init(uv_default_loop(), async, [](uv_async_t *as, int) {
reinterpret_cast<NodeMap *>(as->data)->renderFinished();