added debug context destruction to window destruction