Close pointer on lost connection