added: in FileLog::save_log(): test whether synchro_lock() has returned true
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1216 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
7309c7817d
commit
a29cb45f6a
|
@ -105,34 +105,35 @@ void FileLog::save_log(PT::WTextStream * buffer)
|
||||||
if( buffer->empty() )
|
if( buffer->empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
synchro_lock();
|
if( synchro_lock() )
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if( log_stdout )
|
try
|
||||||
{
|
{
|
||||||
PT::WideToUTF8(*buffer, std::cout);
|
if( log_stdout )
|
||||||
}
|
|
||||||
|
|
||||||
if( !log_file.empty() )
|
|
||||||
{
|
|
||||||
if( !log_file_open || !file )
|
|
||||||
{
|
{
|
||||||
file.close();
|
PT::WideToUTF8(*buffer, std::cout);
|
||||||
file.clear();
|
|
||||||
|
|
||||||
open_file();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( file )
|
if( !log_file.empty() )
|
||||||
{
|
{
|
||||||
PT::WideToUTF8(*buffer, file);
|
if( !log_file_open || !file )
|
||||||
file.flush();
|
{
|
||||||
|
file.close();
|
||||||
|
file.clear();
|
||||||
|
|
||||||
|
open_file();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( file )
|
||||||
|
{
|
||||||
|
PT::WideToUTF8(*buffer, file);
|
||||||
|
file.flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
catch(...)
|
||||||
catch(...)
|
{
|
||||||
{
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
synchro_unlock();
|
synchro_unlock();
|
||||||
|
|
Loading…
Reference in New Issue