MCPcopy Create free account
hub / github.com/KDE/kdevelop / shutdownGracefully

Function shutdownGracefully

kdevplatform/shell/core.cpp:49–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48namespace {
49void shutdownGracefully(int sig)
50{
51 static volatile std::sig_atomic_t handlingSignal = 0;
52
53 if ( !handlingSignal ) {
54 handlingSignal = 1;
55 qCDebug(SHELL) << "signal " << sig << " received, shutting down gracefully";
56 QCoreApplication* app = QCoreApplication::instance();
57 if (auto* guiApp = qobject_cast<QApplication*>(app)) {
58 guiApp->closeAllWindows();
59 }
60 app->quit();
61 return;
62 }
63
64 // re-raise signal with default handler and trigger program termination
65 std::signal(sig, SIG_DFL);
66 std::raise(sig);
67}
68
69void installSignalHandler()
70{

Callers

nothing calls this directly

Calls 1

quitMethod · 0.80

Tested by

no test coverage detected