Browse Source

Fix a small leak

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.1
falkTX 2 years ago
parent
commit
9844d76319
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 7 additions and 0 deletions
  1. +3
    -0
      data/valgrind.sh
  2. +4
    -0
      source/backend/utils/Windows.cpp

+ 3
- 0
data/valgrind.sh 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

+ 4
- 0
source/backend/utils/Windows.cpp 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


Loading…
Cancel
Save