
Hello users. In the past, I wrote a program using the C++ built-in pointers. I made sure that there was not any memory leak: indeed, valgrind reported no memory leaks. I decided to switch to boost::shared_ptr, and replaced all the C++ built-in pointers with boost:shared_ptr ones. Interestingly, valgrind now reports a huge memory leak. I thought that by just replacing the built-in pointers with the boost::shared_ptr pointers (forgetting about explicit deletes of memory) would be enough. Note that I use boost::make_shared<> for memory allocations. I wish I could include the code in this email, but it is very long and complicated. Therefore, I am kindly asking you to guess what might have been wrong with the boost:shared_ptr. Could you think of any scenarios that would cause the observed bahavior? Any ideas would be welcome. OS: Ubuntu 64 Compiler: gcc version 4.4.3 Best Regards, Panagiotis Foteinos

On 27 March 2011 23:57, Panagiotis Foteinos
Sounds like cyclic references[1] for which you may need to use weak_ptr 's. [1]http://www.codeproject.com/KB/stl/boostsmartptr.aspx#Cyclic%20References
participants (3)
-
Igor R
-
liam mail
-
Panagiotis Foteinos