This question always troubles me especially when I'm programming with Qt. Since Qt uses Object Ownership trees, passing a pointer e.g. via myBoostSharedPtr.get() can implicitly transfer ownership. Now consider the case where some Qt Object gets destroyed and the whole Object Tree is destroyed but the smart-pointer is still alive e.g. as member of a different class. What happens if the smart-pointer gets deleted afterwards ? Double deletion with all the nasty consequences ? Do some smart-pointer implementations prevent this ?

Edit
Report