Added memory releases for all windows when closed