On Tue, Feb 20, 2001 at 08:09:51AM -0800, [EMAIL PROTECTED] wrote:
> Hello.
> 
> I'm using Blackbox 61.1 under Redhat 6.0 and have a question about
> something I noticed after running a program called 'si' that lists all
> kinds of information about your running system. Here's what happens:
> 
> If I change styles, then run 'si' (or look in /proc/<the_blackbox_pid>/fd)
> I see at least three more open directories than the previous time I ran
> 'si'. The directories are:
> 
>   /usr/local/share/Blackbox/styles
>   ~/.blackbox/Styles
>   ~/.blackbox/styles
> 
> I was changing styles a lot last week to try and get rid of the ones I
> wasn't really using and saw about 40 open directories. It's as though
> Blackbox is not closing the directory after opening it.
> 
> So, the question is: is this by design or is it a problem? I searched the
> mailing list archives and couldn't find a reference to this behavior.
> 

Hmm. There was a memory/resource leak in the root menu code that
I cleaned up in my devel codebase a little while back. Open up
Screen.cc and jump to line 2224... you should see:

  // get the total number of directory entries
  while ((p = readdir(d))) entries++;
  rewinddir(d);

  char **ls = new char* [entries];
  int index = 0;
  while ((p = readdir(d)))
    ls[index++] = bstrdup(p->d_name);

  closedir(d); // ADD THIS LINE

  qsort(ls, entries, sizeof(char *), dcmp);

If you add the closedir line above, the problem should go away.

Jeff Raven

Reply via email to