plug valgrind-found leak; prefer localtime_r.

This commit is contained in:
ehouse 2009-06-29 12:58:30 +00:00
parent c347bbd963
commit 9b29e45ea4
2 changed files with 8 additions and 1 deletions

View file

@ -70,6 +70,12 @@ CRefMgr::~CRefMgr()
pthread_mutex_destroy( &m_guard );
pthread_rwlock_destroy( &m_cookieMapRWLock );
SocketMap::iterator iter;
for ( iter = m_SocketStuff.begin(); iter != m_SocketStuff.end(); ++iter ) {
SocketStuff* stuff = iter->second;
delete stuff;
}
s_instance = NULL;
}

View file

@ -107,7 +107,8 @@ logf( XW_LogLevel level, const char* format, ... )
}
gettimeofday( &tv, NULL );
timp = localtime( &tv.tv_sec );
struct tm result;
timp = localtime_r( &tv.tv_sec, &result );
pthread_t me = pthread_self();