mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:24:36 +02:00
Don't use unique_ptr to store CrashpadClient
This commit is contained in:
parent
5ab16302ca
commit
250806252e
1 changed files with 7 additions and 5 deletions
|
@ -39,16 +39,17 @@ static const std::string BACKTRACE_TOKEN { CMAKE_BACKTRACE_TOKEN };
|
||||||
|
|
||||||
extern QString qAppFileName();
|
extern QString qAppFileName();
|
||||||
|
|
||||||
|
CrashpadClient* client { nullptr };
|
||||||
std::mutex annotationMutex;
|
std::mutex annotationMutex;
|
||||||
crashpad::SimpleStringDictionary* crashpadAnnotations { nullptr };
|
crashpad::SimpleStringDictionary* crashpadAnnotations { nullptr };
|
||||||
|
|
||||||
|
|
||||||
std::unique_ptr<CrashpadClient> client;
|
|
||||||
|
|
||||||
LONG WINAPI vectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo) {
|
LONG WINAPI vectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo) {
|
||||||
|
if (!client) {
|
||||||
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
|
}
|
||||||
|
|
||||||
if (pExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_HEAP_CORRUPTION ||
|
if (pExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_HEAP_CORRUPTION ||
|
||||||
pExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_STACK_BUFFER_OVERRUN) {
|
pExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_STACK_BUFFER_OVERRUN) {
|
||||||
assert(client);
|
|
||||||
client->DumpAndCrash(pExceptionInfo);
|
client->DumpAndCrash(pExceptionInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +61,8 @@ bool startCrashHandler() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
client.reset(new CrashpadClient());
|
assert(!client);
|
||||||
|
client = new CrashpadClient();
|
||||||
std::vector<std::string> arguments;
|
std::vector<std::string> arguments;
|
||||||
|
|
||||||
std::map<std::string, std::string> annotations;
|
std::map<std::string, std::string> annotations;
|
||||||
|
|
Loading…
Reference in a new issue