mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 19:42:07 +08:00
seldrive: use common sig handler (#28127)
* Update main.cc * Update util.h * same for navd old-commit-hash: e780cca8b63987776d6408c3e1f64fb4c292a78f
This commit is contained in:
+2
-12
@@ -7,22 +7,12 @@
|
||||
#include "selfdrive/navd/map_renderer.h"
|
||||
#include "system/hardware/hw.h"
|
||||
|
||||
|
||||
|
||||
void sigHandler(int s) {
|
||||
qInfo() << "Shutting down";
|
||||
std::signal(s, SIG_DFL);
|
||||
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
qInstallMessageHandler(swagLogMessageHandler);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
std::signal(SIGINT, sigHandler);
|
||||
std::signal(SIGTERM, sigHandler);
|
||||
std::signal(SIGINT, sigTermHandler);
|
||||
std::signal(SIGTERM, sigTermHandler);
|
||||
|
||||
MapRenderer * m = new MapRenderer(get_mapbox_settings());
|
||||
assert(m);
|
||||
|
||||
@@ -17,6 +17,7 @@ QMap<QString, QString> getSupportedLanguages();
|
||||
void configFont(QPainter &p, const QString &family, int size, const QString &style);
|
||||
void clearLayout(QLayout* layout);
|
||||
void setQtSurfaceFormat();
|
||||
void sigTermHandler(int s);
|
||||
QString timeAgo(const QDateTime &date);
|
||||
void swagLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
|
||||
void initApp(int argc, char *argv[], bool disable_hidpi = true);
|
||||
|
||||
@@ -5,17 +5,13 @@
|
||||
#include "selfdrive/ui/qt/util.h"
|
||||
#include "selfdrive/ui/soundd/sound.h"
|
||||
|
||||
void sigHandler(int s) {
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
qInstallMessageHandler(swagLogMessageHandler);
|
||||
setpriority(PRIO_PROCESS, 0, -20);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
std::signal(SIGINT, sigHandler);
|
||||
std::signal(SIGTERM, sigHandler);
|
||||
std::signal(SIGINT, sigTermHandler);
|
||||
std::signal(SIGTERM, sigTermHandler);
|
||||
|
||||
Sound sound;
|
||||
return a.exec();
|
||||
|
||||
Reference in New Issue
Block a user