Closed Bug 131417 Opened 23 years ago Closed 23 years ago

Memory leak in SetUpFontCharSetInfo()

Categories

(SeaMonkey :: UI Design, defect)

x86
FreeBSD
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pj, Assigned: roland.mainz)

Details

(Keywords: memory-leak)

Attachments

(3 files)

In nsFontMetricsGTK.cpp:1992 the following line occurs: NS_WARNING(nsPrintfCString("\n\ncharset = %s", atomToName(charset)).get()); This leaks a char * which atomToName() allocates. I'll attach a patch below.
Keywords: mlk
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 74515 [details] [diff] [review] free the memory allocated by atomToName() r=bzbarsky. Go ahead and ask for sr. :)
Attachment #74515 - Flags: review+
r=pavlov. get blizzard or tor to sr=
Comment on attachment 74515 [details] [diff] [review] free the memory allocated by atomToName() sr=blizzard
Attachment #74515 - Flags: superreview+
Comment on attachment 74515 [details] [diff] [review] free the memory allocated by atomToName() a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #74515 - Flags: approval+
as NS_WARNING goes to /* nothing */ for non-debug builds, shouldn't this code be #ifdef DEBUG ?
Because of the semi-colon?
This patch adds a few more calls compared to how it was, even in an optimized build. The NS_WARNING() is not a part of an optimized build - with this patch there will be a few more syscalls during startup. Since startup time is important it's probably a good idea to avoid adding more calls that will consume CPU cycles (and the result isn't used unless it's a debug build).
Component: XP Toolkit/Widgets → XP Apps: GUI Features
Doh, yes, I see what you mean now (wasn't quite awake before). All that new code should be in a #ifdef DEBUG.
New patch with the ifdefs added. Does the r/sr/a carry over since it is exactly the same code with only a new ifdef?
Comment on attachment 75558 [details] [diff] [review] Patch, with #ifdef DEBUG. Depends on the patch, but sr=jag on the added ifdef, and I'm copying over the r= and a=.
Attachment #75558 - Flags: superreview+
Attachment #75558 - Flags: review+
Attachment #75558 - Flags: approval+
checked in on the trunk
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Reopen - you forgot to patch the Xlib version of the code... ;-(
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Taking...
Assignee: jaggernaut → Roland.Mainz
Status: REOPENED → NEW
Status: NEW → ASSIGNED
Keywords: patch, review
Comment on attachment 75685 [details] [diff] [review] Xlib port of the GTK+ patch r=bzbarsky
Attachment #75685 - Flags: review+
Comment on attachment 75685 [details] [diff] [review] Xlib port of the GTK+ patch sr=scc
Attachment #75685 - Flags: superreview+
Comment on attachment 75685 [details] [diff] [review] Xlib port of the GTK+ patch a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #75685 - Flags: approval+
checked in on trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: