Add destroy function for Window