Destroying various UI elements after window unload.