Click here to Skip to main content
15,885,546 members
Articles / Programming Languages / C++11

How a weak_ptr Might Prevent Full Memory Cleanup of Managed Object

Rate me:
Please Sign up or sign in to vote.
5.00/5 (8 votes)
30 Jan 2018CPOL6 min read 9.2K   5  
It appears that in some cases memory allocated for the object controlled by smart_ptr might not be released until all weak pointers are also ‘dead’... let's see why

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Poland Poland
Software developer interested in creating great code and passionate about teaching.

Author of C++17 In Detail - a book that will teach you the latest features of C++17!

I have around 11 years of professional experience in C++/Windows/Visual Studio programming. Plus other technologies like: OpenGL, game development, performance optimization.

In 2018 I was awarded by Microsoft as MVP, Developer Technologies.

If you like my articles please subscribe to my weekly C++ blog or just visit www.bfilipek.com.

Comments and Discussions