Fix a small leak

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-09-24 19:25:08 +01:00
parent efbebc59f1
commit 9844d76319
No known key found for this signature in database
GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 7 additions and 0 deletions

View File

@ -29,3 +29,6 @@ while true; do
done
wait ${PID}
# export PYTHONMALLOC=malloc
# valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --gen-suppressions=all --suppressions=./data/valgrind.supp python3 ./source/frontend/carla

View File

@ -48,6 +48,7 @@ double carla_get_desktop_scale_factor()
if (::Display* const display = XOpenDisplay(nullptr))
{
XrmInitialize();
if (char* const rms = XResourceManagerString(display))
{
if (const XrmDatabase sdb = XrmGetStringDatabase(rms))
@ -64,8 +65,11 @@ double carla_get_desktop_scale_factor()
if (carla_isNotZero(dpi))
return dpi / 96;
}
XrmDestroyDatabase(sdb);
}
}
XCloseDisplay(display);
}
#endif