News for hackers. Stuff that matters.
Re:Memory management in C programs (2014) by duaneb on Tuesday July 19, 2016 @02:12AM (#12120088)
How does RAII deal with reference loops? It is trivial to create a loop of owned pointers in memory that never decrement, and it isn't that unusual of a pattern not to be a concern.

Just curious; I used a combination of strong/weak reference counting when I dealt with this. It wasn't fast, but it did appear to be less prone to implicit leaking.

Re:Memory management in C programs (2014) by lukewink on Tuesday July 19, 2016 @02:23AM (#12120139)
One method is using weak_ptr.