Use boost::shared_ptr for reference counted memory handling