From 0a942b6f143373c30fdd2027ff75fdb3b0c71551 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 4 Dec 2014 15:46:28 -0800 Subject: Change Map::stop to use std::function Fixes #685 --- include/mbgl/map/map.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 08f4ca5647..23bd211af9 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace mbgl { @@ -31,8 +32,6 @@ class GlyphAtlas; class SpriteAtlas; class Map : private util::noncopyable { - typedef void (*stop_callback)(void *); - public: explicit Map(View&, FileSource&); ~Map(); @@ -43,9 +42,8 @@ public: // Stop the map render thread. This call will block until the map rendering thread stopped. // The optional callback function will be invoked repeatedly until the map thread is stopped. // The callback function should wait until it is woken up again by view.notify(), otherwise - // this will be a busy waiting loop. The optional data parameter will be passed to the callback - // function. - void stop(stop_callback cb = nullptr, void *data = nullptr); + // this will be a busy waiting loop. + void stop(std::function callback = std::function()); // Runs the map event loop. ONLY run this function when you want to get render a single frame // with this map object. It will *not* spawn a separate thread and instead block until the -- cgit v1.2.1