now checking for NULL window in fgDeactivateMenu (thanks for Ioannis to