void KSMServer::cleanUp() { if (clean) return; clean = true; IceFreeListenObjs (numTransports, listenObjs); QByteArray fName = QFile::encodeName(KStandardDirs::locateLocal("socket", "KSMserver")); QString display = QString::fromLocal8Bit(::getenv("DISPLAY")); // strip the screen number from the display display.replace(QRegExp("\\.[0-9]+$"), ""); int i; while( (i = display.indexOf(':')) >= 0) display[i] = '_'; while( (i = display.indexOf('/')) >= 0) display[i] = '_'; fName += '_'+display.toLocal8Bit(); ::unlink(fName.data()); FreeAuthenticationData(numTransports, authDataEntries); signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); KDisplayManager().shutdown( shutdownType, shutdownMode, bootOption ); }
static void CloseListeners(void) { IceFreeListenObjs (numTransports, listenObjs); }