obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
781 stars 222 forks source link

Back up then restore POSIX signal handlers on CefInitialize #366

Closed tt2468 closed 2 years ago

tt2468 commented 2 years ago

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:

After:

Types of changes

Checklist: