diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index a1fc652d6f..297831dfa6 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -2090,6 +2090,7 @@ bool xss_idle(long idle_threshold) { "[idle_detection] XScreenSaver extension not available for DISPLAY '%s'.", it->c_str()); } + XCloseDisplay(disp); continue; } @@ -2098,6 +2099,9 @@ bool xss_idle(long idle_threshold) { XScreenSaverQueryInfo(disp, DefaultRootWindow(disp), xssInfo); idle_time = xssInfo->idle; + // Close the connection to the XServer + XCloseDisplay(disp); + // convert from milliseconds to seconds idle_time = idle_time / 1000;