From acebb668e310da526f262f6a47090eddbb9c76a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 9 Jul 2022 15:54:07 +0200 Subject: [PATCH] Fix memory leak in ns_draw_relief * src/nsterm.m (ns_draw_relief): Assigning the static local variables baseCol and lightCol to nil leaks memory as of the second time ns_draw_relief is called, because the calls to [baseCol release] and [lightCol release] further down the function become a no-op. This bug was introduced in c7b48b61d08f0b6a08584080badc60fe62ba1db1. --- src/nsterm.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index 7f232e7292..dc55edf0eb 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3486,13 +3486,11 @@ larger if there are taller display elements (e.g., characters of some sides not being drawn, and because the rect will be filled. -------------------------------------------------------------------------- */ { - static NSColor *baseCol, *lightCol, *darkCol; + static NSColor *baseCol = nil, *lightCol = nil, *darkCol = nil; NSColor *newBaseCol; NSRect inner; NSBezierPath *p; - baseCol = nil; - lightCol = nil; newBaseCol = nil; p = nil; -- 2.34.1