Back up then restore POSIX signal handlers on CefInitialize #366

Merged
tt2468 merged 1 commit from fix/proc-restore-signals into master 2022-07-13 04:16:15 -05:00
tt2468 commented 2022-07-09 17:39:11 -05:00 (Migrated from github.com)

Description

Using this trick from the Java CEF library, we can back up our process's signal handlers then restore them after calling CefInitialize.

Motivation and Context

CefInitialize likes to wipe all of our precious POSIX signal handlers, leading to an unsafe shutdown if SIGINT is raised and there are browsers running.

How Has This Been Tested?

Ubuntu 20.04 Desktop

Before:

  • SIGINT to OBS with no browsers: Safe shutdown
  • SIGINT to OBS with browsers running: Instant exit (unsafe shutdown)

After:

  • SIGINT to OBS with browsers running: Safe shutdown

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
### Description Using this trick from the Java CEF library, we can back up our process's signal handlers then restore them after calling CefInitialize. ### Motivation and Context CefInitialize likes to wipe all of our precious POSIX signal handlers, leading to an unsafe shutdown if SIGINT is raised and there are browsers running. ### How Has This Been Tested? Ubuntu 20.04 Desktop Before: - `SIGINT` to OBS with no browsers: Safe shutdown - `SIGINT` to OBS with browsers running: Instant exit (unsafe shutdown) After: - `SIGINT` to OBS with browsers running: Safe shutdown ### Types of changes - Bug fix (non-breaking change which fixes an issue) ### Checklist: - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst). - [x] My code is not on the master branch. - [x] The code has been tested. - [x] All commit messages are properly formatted and commits squashed where appropriate. - [x] I have included updates to all appropriate documentation.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser!366
No description provided.