Hacker News new | ask | show | jobs
by btrask 2008 days ago
If you are transferring ownership, you would do

    p2 = p1; p1 = NULL;
However if you are intentionally doing multiple ownership, then yes you can still have problems.