Closed Bug 305017 Opened 20 years ago Closed 20 years ago

Memory Leak: myspell object gets leaked

Categories

(Core :: Spelling checker, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mscott, Assigned: mscott)

References

Details

(Keywords: fixed1.8)

Attachments

(1 file)

in mozMySpell.cpp, SetDictionary creates an instance of class myspell. This object is never deleted in the destructor for mozMySpell. allocator: http://lxr.mozilla.org/mozilla/source/extensions/spellcheck/myspell/src/mozMySpell.cpp#137 failure to delete in the destructor: http://lxr.mozilla.org/mozilla/source/extensions/spellcheck/myspell/src/mozMySpell.cpp#83
Attached patch the fixSplinter Review
1) delete the myspell instance in our destructor 2) Make SetDictionary smart enough (without leaking) to be called more than once (i.e. delete the previous value for mMySpell if there is one. 3) Clean up the destructor for the myspell class to avoid some unnecessary if checks and setting values to NULL after deleting them in the dtor.
Attachment #192990 - Flags: review?(mvl)
I'll need this leak fix in 1.8b4 as part of the work I'm doing for another bug.
Status: NEW → ASSIGNED
Flags: blocking1.8b4+
Blocks: 305020
Comment on attachment 192990 [details] [diff] [review] the fix r=mvl
Attachment #192990 - Flags: review?(mvl) → review+
Attachment #192990 - Flags: superreview?(bienvenu)
Attachment #192990 - Flags: superreview?(bienvenu) → superreview+
Attachment #192990 - Flags: approval1.8b4?
fixed on the trunk
Attachment #192990 - Flags: approval1.8b4? → approval1.8b4+
fixed branch and trunk
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Keywords: fixed1.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: