diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2019-01-30 02:12:41 +0100 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2019-01-30 06:43:56 +0100 |
commit | d308eb091a6c6d73442a118d7069e855ec2b1c6d (patch) | |
tree | f5c0a90604b707a9149446abc9dc3126b7621af5 /platform/x11/os_x11.cpp | |
parent | 35bb52011a4cbcd8ca3779ab1761244f06a33127 (diff) |
Fix many asan and ubsan reported issues
This allows most demos to run without any ubsan or asan errors. There
are still some things in thirdpart/ and some things in AudioServer that
needs a look but this fixes a lot of issues. This should help debug less
obvious issues, hopefully.
This fixes #25217 and fixes #25218
Diffstat (limited to 'platform/x11/os_x11.cpp')
-rw-r--r-- | platform/x11/os_x11.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index e0924fc982..ca4b02bb49 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -3004,7 +3004,9 @@ bool OS_X11::is_vsync_enabled() const { */ void OS_X11::set_context(int p_context) { + char *config_name = NULL; XClassHint *classHint = XAllocClassHint(); + if (classHint) { char *wm_class = (char *)"Godot"; @@ -3015,13 +3017,15 @@ void OS_X11::set_context(int p_context) { if (p_context == CONTEXT_ENGINE) { classHint->res_name = (char *)"Godot_Engine"; - wm_class = (char *)((String)GLOBAL_GET("application/config/name")).utf8().ptrw(); + config_name = strdup((char *)((String)GLOBAL_GET("application/config/name")).utf8().ptrw()); + wm_class = config_name; } classHint->res_class = wm_class; XSetClassHint(x11_display, x11_window, classHint); XFree(classHint); + free(config_name); } } |