GNU bug report logs - #79023
30.1.90; Suspicion of memory leak on internal_redisplay (MacOS)

Previous Next

Package: emacs;

Reported by: Przemysław Alexander Kamiński <przemyslaw <at> kaminski.se>

Date: Tue, 15 Jul 2025 07:14:01 UTC

Severity: normal

Found in version 30.1.90

Full log


Message #41 received at 79023 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Przemysław Alexander Kamiński
 <przemyslaw <at> kaminski.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 79023 <at> debbugs.gnu.org
Subject: Re: bug#79023: 30.1.90; Suspicion of memory leak on
 internal_redisplay (MacOS)
Date: Wed, 16 Jul 2025 15:45:21 +0100
On Wed, Jul 16, 2025 at 02:54:06PM +0200, Przemysław Alexander Kamiński wrote:
> 
> diff --git a/src/nsfont.m b/src/nsfont.m
> index b8aa6764..f99980b1 100644
> --- a/src/nsfont.m
> +++ b/src/nsfont.m
> @@ -529,6 +529,10 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
>        chars[95] = '\0';
>  
>        ascii_printable = [[NSString alloc] initWithFormat: @"%s", chars];
> +      if (ascii_printable != nil )
> +      {
> +        [ascii_printable autorelease];
> +      }
>      }
>  
>    if (w < (CGFloat) 0.0)

Is this the full patch? Unfortunately nsfont.m isn't used on macos,
it's only for GNUstep.

Also I'm pretty sure that when using alloc the object's lifetime is
restricted to the calling function, you need to retain the object if
you want to keep it.

I'm not saying we definitely don't make a mistake somewhere with
retain/release, but this probably isn't it.
-- 
Alan Third




This bug report was last modified 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.