From 600ae24657e9245d900da41bba10c9ea0dd25ff1 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Sat, 26 Jul 2014 15:05:26 -0400 Subject: [PATCH] separate one try/catch into two blocks during file_appender destructor --- src/log/file_appender.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/log/file_appender.cpp b/src/log/file_appender.cpp index 686ed65..e7d62cc 100644 --- a/src/log/file_appender.cpp +++ b/src/log/file_appender.cpp @@ -82,14 +82,22 @@ namespace fc { ~impl() { - try - { - _rotation_task.cancel_and_wait(); - if( _compression_thread ) _compression_thread->quit(); - } - catch( ... ) - { - } + try + { + _rotation_task.cancel_and_wait(); + } + catch( ... ) + { + } + + try + { + if( _compression_thread ) + _compression_thread->quit(); + } + catch( ... ) + { + } } void rotate_files( bool initializing = false ) @@ -108,7 +116,7 @@ namespace fc { { 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; }