[node] Destroy the RunLoop with the last Map object
The last map object to get destroyed will also destroy the RunLoop (which will also destroy the AsyncTask). This will clear any reference to the Node default main loop and let it close. Downside is that we need to make sure we are always calling `map.release()`.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/storage/file_source.hpp>
|
||||
#include <mbgl/platform/default/headless_view.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
@@ -45,6 +46,7 @@ public:
|
||||
std::unique_ptr<mbgl::FileRequest> request(const mbgl::Resource&, Callback);
|
||||
|
||||
mbgl::HeadlessView view;
|
||||
std::shared_ptr<mbgl::util::RunLoop> loop;
|
||||
std::unique_ptr<mbgl::Map> map;
|
||||
|
||||
std::exception_ptr error;
|
||||
|
||||
Reference in New Issue
Block a user