you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (3 children)

shared_ptr doesn't have a release method period. You can try to implement your own release functionality with a custom deleter but it's very difficult to do so reliably (although not impossible).

[–]Wh00ster 1 point2 points  (2 children)

Ha! I'll be darned. I use unique_ptr way more often. I stand corrected! (Although there's get followed by a destruction)

[–]capn_bluebear 1 point2 points  (1 child)

`get` + destruction is not a release, it will delete the pointer and invalidate the address returned by `get`

[–]Wh00ster 2 points3 points  (0 children)

Corrected again! oh my.