15 Nov
2006
15 Nov
'06
3:36 a.m.
Can anyone offer advice on detecting circular references with shared_ptrs. I have a large app, 50+ classes, and most objects are managed with shared_ptrs. No consideration has gone into avoid circular references, so I'm sure there will be a few in there. I thinking that looking though all the classes and their attributes will take a while. Any suggestions/advice in finding circular references (so i can use weak_ptrs)? I was thinking of maybe getting a tool that draws the class diagram. Or having a base class for all my classes that reference count to a global variable to detect the number of leaks. It seems the shared_ptr is a good idea for memory management, but it opens up the original problem of memory leaks...