mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Exit right away if the parent process died
This commit is contained in:
parent
462ec30cac
commit
6b5b905b2a
2 changed files with 5 additions and 5 deletions
|
@ -1081,7 +1081,7 @@ void setMaxCores(uint8_t maxCores) {
|
|||
void quitWithParentProcess() {
|
||||
if (qApp) {
|
||||
qDebug() << "Parent process died, quitting";
|
||||
qApp->quit();
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1134,7 +1134,7 @@ QString GetLastErrorAsString() {
|
|||
return QString::fromStdString(message);
|
||||
}
|
||||
|
||||
HANDLE createJobObject() {
|
||||
void *createJobObject() {
|
||||
HANDLE jobObject = CreateJobObject(nullptr, nullptr);
|
||||
if (jobObject == nullptr) {
|
||||
qWarning() << "Could NOT create job object:" << GetLastErrorAsString();
|
||||
|
@ -1155,7 +1155,7 @@ HANDLE createJobObject() {
|
|||
return jobObject;
|
||||
}
|
||||
|
||||
void addProcessToJobObject(HANDLE jobObject, DWORD processId) {
|
||||
void addProcessToJobObject(void *jobObject, qint64 processId) {
|
||||
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
|
||||
if (hProcess == nullptr) {
|
||||
qCritical() << "Could NOT open process" << GetLastErrorAsString();
|
||||
|
|
|
@ -240,8 +240,8 @@ void watchParentProcess(int parentPID);
|
|||
|
||||
|
||||
#ifdef _WIN32
|
||||
HANDLE createJobObject();
|
||||
void addProcessToJobObject(HANDLE jobObject, DWORD processId);
|
||||
void *createJobObject();
|
||||
void addProcessToJobObject(void *jobObject, qint64 processId);
|
||||
#endif
|
||||
|
||||
#endif // hifi_SharedUtil_h
|
||||
|
|
Loading…
Reference in a new issue