The lifecycle of a ghost instance on the server side

Which system is responsible for deleting the ghost instance when the client disconnects?