added get method to smart pointer
clean window deletion