Destructor for the typified smart pointer.
Decrements the reference counter of the referenced object. When the reference count reaches zero, the referenced object is deleted.