Dominik Vogt <fvwm-workers@fvwm.org> writes:
> On Fri, Jun 08, 2001 at 09:06:56AM -0400, Dan Espen wrote:
> > Andrey Panov <[EMAIL PROTECTED]> writes:
> > > 
> > > It seems that opening of new window increases fvwm's memory size
> > > by 10-20Kb and memory is not freed after closing of the window.
> > 
> > This looks suspicious in add_window.c line 347:
> > 
> > static void destroy_icon_font(FvwmWindow *tmp_win)
> > {
> >   if (IS_ICON_FONT_LOADED(tmp_win) && !USING_DEFAULT_ICON_FONT(tmp_win) &&
> >       tmp_win->title_font.font != Scr.DefaultFont.font)
> >   {
> >     FreeFvwmFont(dpy, &(tmp_win->icon_font));
> >   }
> >   SET_ICON_FONT_LOADED(tmp_win, 0);
> >   /* Fall back to default font (see comment above). */
> >   tmp_win->icon_font = Scr.DefaultFont;
> >   SET_USING_DEFAULT_ICON_FONT(tmp_win, 1);
> > }
> > 
> > Try changing title_font to icon_font.
> > I have some work to do and can't check it myself until later.
> 
> This could lead to a core dump, but I don't see how this can be a
> memory leak.  Fvwm does never load fonts more than once.

Using multibyte and Adrey's config file I did see  a growing fvwm2 and
Purify reported these at termination:

MLK: 24576 bytes leaked in 8 blocks
  * This memory was allocated from:
        malloc         [rtlib.o]
        _XQueryFont    [Font.c]
        XLoadQueryFont [Font.c]
        load_font      [XSunOMIF.c]
        create_fontset [XSunOMIF.c]
        create_oc      [XSunOMIF.c]
        XCreateOC      [OCWrap.c]
        XCreateFontSet [FSWrap.c]
        GetFontSetOrFixed [GetFont.c:65]
        LoadFvwmFont   [GetFont.c:106]
        setup_icon_font [add_window.c:378]
        AddWindow      [add_window.c:1307]
        HandleMapRequestKeepRaised [events.c:1035]
        HandleMapRequest [events.c:999]
        DispatchEvent  [events.c:2766]
        HandleEvents   [events.c:2819]
        main           [fvwm.c:742]
        _start         [crt1.o]
  * Block of 3072 bytes (8 times); last block at 0x324d38

I don't normally use icon titles so I might have missed them
in previous tests.  Also I'm not sure if leaks at termination
are really leaks, if you are going to exit, theres no point in
freeing things.  It does look like there were 8 icon fonts allocated.
Thats close to the number of windows I created.

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [EMAIL PROTECTED]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to