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();
if (monitor != null) {
try {
monitor.desktopDestroyed(desktop);
} catch (Throwable ex) {
log.error(ex);
}
}