Shared/Metric: Stop metrics on shutdown

Properly stop metric information gathering and sending on shutdown.
Issue reported by AddressSanitizer.
This commit is contained in:
jackpoz
2017-12-02 20:24:30 +01:00
committed by Aokromes
parent d9501acb3f
commit 84abf3a1a6

View File

@@ -212,7 +212,12 @@ void Metric::ForceSend()
{
// Send what's queued only if io_service is stopped (so only on shutdown)
if (_enabled && _batchTimer->get_io_service().stopped())
{
_enabled = false;
SendBatch();
_batchTimer->cancel();
_overallStatusTimer->cancel();
}
}
void Metric::ScheduleOverallStatusLog()