Cleanup the MapContext before the util::Thread destructor
The util::Thread will call the stop() method of the MapContext's RunLoop which will wait for the pending tasks tied to it to complete. If we have a request that is timeout'ing, this could mean a really long wait. Instead, we now send a cleanup message that will reset all the attributes first (canceling the pending requests) so the the MapContext gets destructed quickly.
This commit is contained in:
@@ -36,6 +36,11 @@ MapContext::MapContext(uv_loop_t* loop, View& view_, FileSource& fileSource, Map
|
||||
}
|
||||
|
||||
MapContext::~MapContext() {
|
||||
// Make sure we call cleanup() before deleting this object.
|
||||
assert(!style);
|
||||
}
|
||||
|
||||
void MapContext::cleanup() {
|
||||
view.notify();
|
||||
|
||||
// Explicit resets currently necessary because these abandon resources that need to be
|
||||
|
||||
Reference in New Issue
Block a user