summaryrefslogtreecommitdiff
path: root/platform/x11/os_x11.cpp
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2019-01-30 02:12:41 +0100
committerHein-Pieter van Braam <hp@tmm.cx>2019-01-30 06:43:56 +0100
commitd308eb091a6c6d73442a118d7069e855ec2b1c6d (patch)
treef5c0a90604b707a9149446abc9dc3126b7621af5 /platform/x11/os_x11.cpp
parent35bb52011a4cbcd8ca3779ab1761244f06a33127 (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.cpp6
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);
}
}