mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-24 23:28:09 +00:00
feat(SingleApplication): don't touch sockets when SIGABRT, SIGBUS or SIGSEGV is handled
This commit is contained in:
parent
c850958987
commit
9cf08623e3
1 changed files with 10 additions and 0 deletions
|
|
@ -256,11 +256,21 @@ void SingleApplicationPrivate::connectToPrimary (int msecs, char connectionType)
|
|||
return;
|
||||
}
|
||||
|
||||
// Dangerous signals. Exit directly after shared memory destruction.
|
||||
// Don't touch sockets => avoid dead locks.
|
||||
for (int crashSig : { SIGABRT, SIGBUS, SIGSEGV })
|
||||
if (signum == crashSig) {
|
||||
for (SingleApplicationPrivate *d : sharedMem)
|
||||
delete d->memory;
|
||||
goto forceExit;
|
||||
}
|
||||
|
||||
while (!sharedMem.empty()) {
|
||||
delete sharedMem.back();
|
||||
sharedMem.pop_back();
|
||||
}
|
||||
|
||||
forceExit:
|
||||
::exit(128 + signum);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue