Subject: | Doesn't deallocate X resources |
X11-IdleTime-0.01,perl, v5.8.4, Debian.
When running GetIdleTime in a loop, it will allocate all Xresources ending up in:
Xlib:Maximum number of clients reached
Attached patch fixes this problem by deallocating the resources used by GetIdleTime.
*** X11-IdleTime-0.01/IdleTime.pm 2003-02-08 06:22:42.000000000 +0100
--- IdleTime.pm 2004-09-30 11:58:29.000000000 +0200
***************
*** 67,71 ****
--- 67,73 ----
screen = DefaultScreen(display);
XScreenSaverQueryInfo(display, RootWindow(display,screen), mit_info);
idle_time = (mit_info->idle) / 1000;
+ XFree(mit_info);
+ XCloseDisplay(display);
return idle_time;
}