There is such code:
_object = std::shared_ptr<Object>(new Object()); If it took me an object to become empty, then I would do this:
_object = nullptr; And then again I want to use this variable and call it again.
_object = std::shared_ptr<Object>(new Object()); Question: Will there be a memory leak and is it right to do this?