8000 Do not allocate DefaultContext in shutdownThreadPool(). · log4cplus/log4cplus@56974af · GitHub
[go: up one dir, main page]

Skip to content

Commit 56974af

Browse files
committed
Do not allocate DefaultContext in shutdownThreadPool().
This fixes #278 or its part.
1 parent 7da93c9 commit 56974af

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/global-init.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,13 @@ enqueueAsyncDoAppend (SharedAppenderPtr const & appender,
309309
void
310310
shutdownThreadPool ()
311311
{
312-
LOG4CPLUS_THREADED (get_dc ()->thread_pool.reset ());
312+
#if ! defined (LOG4CPLUS_SINGLE_THREADED)
313+
DefaultContext * const dc = get_dc (false);
314+
if (dc && dc->thread_pool)
315+
{
316+
dc->thread_pool.reset ();
317+
}
318+
#endif
313319
}
314320

315321

0 commit comments

Comments
 (0)
0