Added check to verify that we have something to clean up before calling do_free

[SVN r18075]
This commit is contained in:
John Maddock
2003-03-24 12:36:55 +00:00
parent ea96eafacc
commit 3819294ac1

View File

@ -503,7 +503,7 @@ w32_regex_traits<char>::~w32_regex_traits()
#endif #endif
// add reference to static member here to ensure // add reference to static member here to ensure
// that the linker includes it in the .exe: // that the linker includes it in the .exe:
if((--entry_count == 0) && (0 != &w32_regex_traits<char>::i)) if((--entry_count == 0) && (0 != &w32_regex_traits<char>::i) && is_init)
do_free(); do_free();
#ifdef BOOST_HAS_THREADS #ifdef BOOST_HAS_THREADS
g.acquire(false); g.acquire(false);
@ -672,7 +672,7 @@ w32_regex_traits<wchar_t>::~w32_regex_traits()
#endif #endif
// add reference to static member here to ensure // add reference to static member here to ensure
// that the linker includes it in the .exe: // that the linker includes it in the .exe:
if((--entry_count == 0) && (0 != &w32_regex_traits<wchar_t>::init_)) if((--entry_count == 0) && (0 != &w32_regex_traits<wchar_t>::init_) && is_init)
do_free(); do_free();
#ifdef BOOST_HAS_THREADS #ifdef BOOST_HAS_THREADS
g.acquire(false); g.acquire(false);