dangling pointer
dangling pointer
dangling pointer
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
oost::weak_ptr Object Access (cont.)Alternatively, you can use a boost::shared_ptr constructor instead of theweak <strong>pointer</strong>’s lock() member.color window::get_parent_bkgr_color(){// We may not have a parent anymoretry{boost::shared_ptr safe_parent(m_parent);return safe_parent->get_bkgr_color();}catch(boost::bad_weak_ptr&) {throw no_parent;}}