separate one try/catch into two blocks during file_appender destructor

This commit is contained in:
Eric Frias 2014-07-26 15:05:26 -04:00
parent 24ba357b0d
commit 600ae24657

View file

@ -82,14 +82,22 @@ namespace fc {
~impl() ~impl()
{ {
try try
{ {
_rotation_task.cancel_and_wait(); _rotation_task.cancel_and_wait();
if( _compression_thread ) _compression_thread->quit(); }
} catch( ... )
catch( ... ) {
{ }
}
try
{
if( _compression_thread )
_compression_thread->quit();
}
catch( ... )
{
}
} }
void rotate_files( bool initializing = false ) void rotate_files( bool initializing = false )
@ -108,7 +116,7 @@ namespace fc {
{ {
if( start_time <= _current_file_start_time ) if( start_time <= _current_file_start_time )
{ {
_rotation_task = schedule( [this]() { rotate_files(); }, _current_file_start_time + cfg.rotation_interval.to_seconds() ); _rotation_task = schedule( [this]() { rotate_files(); }, _current_file_start_time + cfg.rotation_interval.to_seconds(), "log_rotation_task" );
return; return;
} }