mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Exceptions: A bit more consistency in callback registeration.
This commit is contained in:
parent
c3016fe6a5
commit
96a40bb36d
1 changed files with 7 additions and 3 deletions
|
@ -2,6 +2,8 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
// The corresponding file is called MemTools in the Dolphin project.
|
||||
|
||||
#include "Common/ExceptionHandlerSetup.h"
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
@ -82,6 +84,7 @@ void InstallExceptionHandler(BadAccessHandler badAccessHandler) {
|
|||
// Make sure this is only called once per process execution
|
||||
// Instead, could make a Uninstall function, but whatever..
|
||||
if (g_badAccessHandler) {
|
||||
g_badAccessHandler = badAccessHandler;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -189,13 +192,13 @@ static void ExceptionThread(mach_port_t port) {
|
|||
}
|
||||
|
||||
void InstallExceptionHandler(BadAccessHandler badAccessHandler) {
|
||||
if (!g_badAccessHandler) {
|
||||
g_badAccessHandler = badAccessHandler;
|
||||
} else {
|
||||
if (g_badAccessHandler) {
|
||||
// The rest of the setup we don't need to do again.
|
||||
g_badAccessHandler = badAccessHandler;
|
||||
return;
|
||||
}
|
||||
g_badAccessHandler = badAccessHandler;
|
||||
|
||||
INFO_LOG(SYSTEM, "Installing exception handler");
|
||||
mach_port_t port;
|
||||
CheckKR("mach_port_allocate",
|
||||
|
@ -286,6 +289,7 @@ static void sigsegv_handler(int sig, siginfo_t* info, void* raw_context) {
|
|||
|
||||
void InstallExceptionHandler(BadAccessHandler badAccessHandler) {
|
||||
if (g_badAccessHandler) {
|
||||
g_badAccessHandler = badAccessHandler;
|
||||
return;
|
||||
}
|
||||
NOTICE_LOG(SYSTEM, "Installed exception handler");
|
||||
|
|
Loading…
Add table
Reference in a new issue