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:
Thiago Marcos P. Santos
2015-05-29 15:30:50 +03:00
parent 29b8b44b77
commit b09df7acb5
4 changed files with 9 additions and 0 deletions

View File

@@ -19,4 +19,5 @@ TEST(MapContext, DoubleStyleLoad) {
context.invokeSync(&MapContext::setStyleJSON, "", "");
context.invokeSync(&MapContext::setStyleJSON, "", "");
context.invokeSync(&MapContext::cleanup);
}