refactor(NLVObject): use smart pointers for tracking object lifetime
@mbroadst I had a lazy evening and a crazy idea to use weak pointers instead of NLVObjectPtr. Note: enable_shared_from_this is probably not necessary but I wanted you to see this branch earlier rather than later to get some comments.
yeah definitely now that we've committed to c++11, smart pointers are of course the way to go :)
@Rush I left a few comments. I really like the direction this is taking, but I wonder if we can't split the single commit into at least two:
- one for the move to
std::unique_ptr+ all of thehandle_=>handle()changes - one for your idea with
std::shared_ptr
It's a bit hard to review this mono-commit version because of all the handle_ => handle() noise, and frankly I would merge that one right in because it's pretty straightforward and obviously the better solution.
Thoughts?
Sure, I'll split it later this evening probably. Thanks for leaving the comments.