summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
authorIbrahn Sahir <ibrahn.sahir@gmail.com>2019-05-23 19:57:10 +0100
committerIbrahn Sahir <ibrahn.sahir@gmail.com>2019-05-23 20:06:56 +0100
commit63068e2ccddfebbec14b806af244daa4cb4d65a8 (patch)
tree67dc51d53fefe6588b04a741ac99c0b7bb0c6d99 /platform/windows
parent7c73a741f3bb1fd598b6443cb9f8d8e10fb9f36f (diff)
Check project settings live before lookup in crash handler
In x11, windows and osx crash handlers, check project settings exists before looking up the crash handler message setting. Avoids crashing the crash handler when handling a crash outside project settings lifetime. Instead omitting the configurable message and continuing with trace dump.
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/crash_handler_windows.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/windows/crash_handler_windows.cpp b/platform/windows/crash_handler_windows.cpp
index 4006c4c60e..0716ee67f4 100644
--- a/platform/windows/crash_handler_windows.cpp
+++ b/platform/windows/crash_handler_windows.cpp
@@ -166,11 +166,16 @@ DWORD CrashHandlerException(EXCEPTION_POINTERS *ep) {
line.SizeOfStruct = sizeof(line);
IMAGE_NT_HEADERS *h = ImageNtHeader(base);
DWORD image_type = h->FileHeader.Machine;
- int n = 0;
- String msg = GLOBAL_GET("debug/settings/crash_handler/message");
+
+ String msg;
+ const ProjectSettings *proj_settings = ProjectSettings::get_singleton();
+ if (proj_settings) {
+ msg = proj_settings->get("debug/settings/crash_handler/message");
+ }
fprintf(stderr, "Dumping the backtrace. %ls\n", msg.c_str());
+ int n = 0;
do {
if (skip_first) {
skip_first = false;