This is called when the last shared reference is released. The destructor will be called when the last weak reference is released. A buffer owner will always call this function before the calling the destructor, unless an exception was thrown by the constructor.