I have encountered a problem of cyclic reference in some of my programs that I wrote.
When I changed that cyclic type to weak_ptr, the leaks were gone.
However, when I used those weak_ptr's outside that module, the pointers expired.
Any ideas I can solve that, similiar situation to this...
(This crashes)
Actually, the variable I used is in a loop, so that it is reset in each iteration.
That's why the weak_ptr is expired.
It's like when I loop thru the neighbours of the current node,
one of the neighbours will replace the current node and
the current node will open some neigbouring nodes again
and so on so forth
As a consequence, the final path which contains the transitions which in turn contains the nodes
will be leaked, and all other invalid nodes that are not in the path will be automatically destroyed.
if I use shared_ptr's, otherwise, using weak_ptr's will cause the nodes to be expired
when the "current" node is reset.
Last edited by lucky6969b; June 6th, 2016 at 10:07 AM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.