fix space leak in recordShutdown