Skip to content

Commit 6e21e55

Browse files
itsXuStdeepin-bot[bot]
authored andcommitted
fix: relaunch app if exception was catched
Log: as above. Bug: https://pms.uniontech.com/bug-view-304245.html (cherry picked from commit 289e1a5)
1 parent a479489 commit 6e21e55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

deepin-system-monitor-main/stack_trace.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <unistd.h>
1919

2020
#include <QStandardPaths>
21+
#include <QProcess>
2122

2223
namespace util {
2324

@@ -85,6 +86,9 @@ static inline void printStacktrace(int signum)
8586
sigaction(signum, &act, nullptr);
8687
// raise origin signal
8788
raise(signum);
89+
90+
QString cmd = R"(sleep 0.1 && dbus-send --session --print-reply --dest=com.deepin.SessionManager /com/deepin/StartManager com.deepin.StartManager.Launch string:"/usr/share/applications/deepin-system-monitor.desktop";)";
91+
QProcess::startDetached("bash", { "-c", cmd });
8892
}
8993

9094
/**
@@ -109,6 +113,6 @@ void installCrashHandler()
109113
sigaction(SIGABRT, &act, nullptr);
110114
}
111115

112-
} // namespace util
116+
} // namespace util
113117

114-
#endif // STACK_TRACE_H
118+
#endif // STACK_TRACE_H

0 commit comments

Comments
 (0)