diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp index 245aa2992..d7c88b128 100644 --- a/include/llmr/map/map.hpp +++ b/include/llmr/map/map.hpp @@ -27,6 +27,7 @@ public: ~Map(); void start(); + void run(); void stop(); /* setup */ diff --git a/src/map/map.cpp b/src/map/map.cpp index 661b41cdf..019ba97c6 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -45,8 +45,11 @@ void Map::stop() { void Map::eventloop(void *arg) { Map *map = static_cast(arg); + map->run(); +} - uv_run(map->loop, UV_RUN_DEFAULT); +void Map::run() { + uv_run(loop, UV_RUN_DEFAULT); } void Map::setup() { diff --git a/test/headless.cpp b/test/headless.cpp index 0dbf79d40..86f112c2a 100644 --- a/test/headless.cpp +++ b/test/headless.cpp @@ -105,7 +105,7 @@ TEST(Headless, initialize) { map.update(); // Run the loop. It will terminate when we don't have any further listeners. - uv_run(uv_default_loop(), UV_RUN_DEFAULT); + map.run(); map.render();