mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
Merge branch 'crash_at_exit' of github.com:gavinandresen/bitcoin-git
This commit is contained in:
commit
cf64347d70
1 changed files with 8 additions and 2 deletions
10
src/util.cpp
10
src/util.cpp
|
@ -220,8 +220,14 @@ inline int OutputDebugStringF(const char* pszFormat, ...)
|
||||||
if (fileout)
|
if (fileout)
|
||||||
{
|
{
|
||||||
static bool fStartedNewLine = true;
|
static bool fStartedNewLine = true;
|
||||||
static boost::mutex mutexDebugLog;
|
|
||||||
boost::mutex::scoped_lock scoped_lock(mutexDebugLog);
|
// This routine may be called by global destructors during shutdown.
|
||||||
|
// Since the order of destruction of static/global objects is undefined,
|
||||||
|
// allocate mutexDebugLog on the heap the first time this routine
|
||||||
|
// is called to avoid crashes during shutdown.
|
||||||
|
static boost::mutex* mutexDebugLog = NULL;
|
||||||
|
if (mutexDebugLog == NULL) mutexDebugLog = new boost::mutex();
|
||||||
|
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
|
||||||
|
|
||||||
// reopen the log file, if requested
|
// reopen the log file, if requested
|
||||||
if (fReopenDebugLog) {
|
if (fReopenDebugLog) {
|
||||||
|
|
Loading…
Reference in a new issue