mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-12 16:00:40 +02:00
Merge pull request #641 from Sonicadvance1/uninstall_handlers
Uninstalls both the signal delegator and logmanager handlers on shutdown
This commit is contained in:
commit
0c1510e763
5 files changed
+25
No files matched your search
@@ -277,10 +277,15 @@ int main(int argc, char **argv, char **const envp) {
|
||||
|
||||
auto ProgramStatus = FEXCore::Context::GetProgramStatus(CTX);
|
||||
|
||||
SyscallHandler.reset();
|
||||
SignalDelegation.reset();
|
||||
FEXCore::Context::DestroyContext(CTX);
|
||||
|
||||
FEXCore::Config::Shutdown();
|
||||
|
||||
LogMan::Throw::UnInstallHandlers();
|
||||
LogMan::Msg::UnInstallHandlers();
|
||||
|
||||
if (OutputFD != stderr &&
|
||||
OutputFD != stdout &&
|
||||
OutputFD != nullptr) {
|
||||
|
||||
@@ -317,6 +317,21 @@ namespace FEX::HLE {
|
||||
}
|
||||
}
|
||||
|
||||
SignalDelegator::~SignalDelegator() {
|
||||
for (int i = 0; i < MAX_SIGNALS; ++i) {
|
||||
if (i == 0 ||
|
||||
i == SIGKILL ||
|
||||
i == SIGSTOP ||
|
||||
!HostHandlers[i].Installed
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
sigaction(i, &HostHandlers[i].OldAction, nullptr);
|
||||
HostHandlers[i].Installed = false;
|
||||
}
|
||||
GlobalDelegator = nullptr;
|
||||
}
|
||||
|
||||
void SignalDelegator::RegisterTLSState(FEXCore::Core::InternalThreadState *Thread) {
|
||||
ThreadData.Thread = Thread;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace FEX::HLE {
|
||||
// Returns true if the host handled the signal
|
||||
// Arguments are the same as sigaction handler
|
||||
SignalDelegator();
|
||||
virtual ~SignalDelegator();
|
||||
|
||||
/**
|
||||
* @brief Registers an emulated thread's object to a TLS object
|
||||
|
||||
Reference in new issue
Block a user