private static void desktopDestroyed(Desktop desktop) {
final Session sess = desktop.getSession();
final WebApp wapp = desktop.getWebApp();
((DesktopCtrl)desktop).invokeDesktopCleanups();
final Configuration config = wapp.getConfiguration();
config.invokeDesktopCleanups(desktop);
//Feature 1767347: call DesktopCleanup before desktopDestroyed
//such that app dev has a chance to manipulate the desktop
((WebAppCtrl)wapp).getUiEngine().desktopDestroyed(desktop);
final Monitor monitor = desktop.getWebApp().getConfiguration().getMonitor();