NanAssignPersistent source in NodeMap constructor, fixes #109
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user