GNU bug report logs - #56462
29.0.50; [PATCH] Memory leak in ns_draw_relief

Previous Next

Package: emacs;

Reported by: Daniel Martín <mardani29 <at> yahoo.es>

Date: Sat, 9 Jul 2022 14:14:01 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Martín <mardani29 <at> yahoo.es>
To: 56462 <at> debbugs.gnu.org
Subject: bug#56462: 29.0.50; [PATCH] Memory leak in ns_draw_relief
Date: Sat, 09 Jul 2022 16:13:39 +0200
[Message part 1 (text/plain, inline)]
I ran the Leaks tool with Emacs 29, and I've found a memory leak in the
NS version of Emacs.

Since commit c7b48b61d08f0b6a08584080badc60fe62ba1db1, in function
ns_draw_relief, static local variables baseCol and lightCol are assigned
to nil separately to their declaration.  That has the subtle consequence
that the further down calls to [baseCol release] and [lightCol release]
become a no-op, so each time ns_draw_relief is called it leaks some
instances of NSColor.

The fix is to revert to the previous way those static variables were
declared.

I've attached a patch with the correction.  With this fix, the leaks
tool doesn't report the NSColor leaks anymore when I play around with
Emacs 29.

Thanks.

[0001-Fix-memory-leak-in-ns_draw_relief.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 254 days ago.

Previous Next


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