ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: Boost.Thread : Memory leakage with thread local storage?
by Michael Glassford other posts by this author
Jan 19 2004 10:42PM messages near this date
[boost] Re: Re: Boost.Thread : Memory leakage with thread localstorage? | Re: [boost] Re: Boost.Thread : Memory leakage with thread local storage?
Roland wrote:
>  The thread local storage leaks memory on Windows/MSVC6.
> 
>  Is this a know issue?
> 
>  Small example (the tss.cpp example amended by leak debugging
>  functions):
> 

<snipped example> 

First of all, if I understand correctly, in your example you put the
_CrtDumpMemoryLeaks() call too early: since it simply lists all blocks
that are allocated at the time when it is called, it should normally
be called at a point where all memory ought to have been freed; so the
beginning of the main() function seems to be the wrong place for it. A
better way would be the end of main() (though this is still too early
in that static objects haven't been destroyed and released their
memory yet); perhaps even better is to call

    CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF |
_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))

which sets a flag telling the memory allocator to check for leaks on
exit. However, even with these methods I still see "leaks" reported. I
have yet to determine which of them are real problems and which are
valid behavior, but will look into it.

Mike



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Roland
Michael Glassford
Michael Glassford
Roland
Michael Glassford

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved