You just do
ptr.reset();
See the shared_ptr manual. It is equivalent to
shared_ptr<T>().swap(ptr)
You call reset on every smart pointer that should not reference the object anymore. The last such reset (or any other action that causes the reference count drop to zero, actually) will cause the object to be free’ed using the deleter automatically.
Maybe you are interested in the Smart Pointer Programming Techniques. It has an entry about delayed deallocation.