expose map.release() method

This commit is contained in:
Mike Morris
2015-05-20 17:19:36 -04:00
parent e4536789eb
commit fe3d6bbbd5
7 changed files with 117 additions and 27 deletions

View File

@@ -27,10 +27,14 @@ public:
static NAN_METHOD(New);
static NAN_METHOD(Load);
static NAN_METHOD(Render);
static NAN_METHOD(Release);
void startRender(std::unique_ptr<NodeMap::RenderOptions> options);
void renderFinished();
void release();
inline bool isValid() { return valid; }
static std::unique_ptr<NodeMap::RenderOptions> ParseOptions(v8::Local<v8::Object> obj);
static v8::Persistent<v8::FunctionTemplate> constructorTemplate;
@@ -47,7 +51,7 @@ private:
mbgl::HeadlessView view;
NodeFileSource &fs;
mbgl::Map map;
std::unique_ptr<mbgl::Map> map;
std::exception_ptr error;
std::unique_ptr<const mbgl::StillImage> image;
@@ -55,6 +59,8 @@ private:
// Async for delivering the notifications of render completion.
uv_async_t *async;
bool valid = true;
};
}