Closed
Bug 365798
Opened 18 years ago
Closed 18 years ago
IME leaks nsPrivateTextRangeList objects
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: smaug, Assigned: smaug)
Details
(Keywords: inputmethod, memory-leak)
Attachments
(1 file, 2 obsolete files)
12.45 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
IME leaks nsPrivateTextRangeList objects. A patch, which also cleans up nsPrivateTextRangeList, coming.
Assignee | ||
Comment 1•18 years ago
|
||
I'm not quite sure who should review this.
Assignee: smontagu → Olli.Pettay
Status: NEW → ASSIGNED
Attachment #250345 -
Flags: review?(masayuki)
Attachment #250345 -
Flags: superreview?(roc)
I'll review it. However, I'd prefer that you didn't inherit from nsTArray. I think you should just make it a member instead.
Assignee | ||
Comment 3•18 years ago
|
||
(In reply to comment #2) > However, I'd prefer that you didn't inherit from nsTArray. I > think you should just make it a member instead. > Any reason for that? I like the simplicity when inheriting nsTArray.
Just a healthy prejudice against multiple inheritance. Also, it means that your class exposes all nsTArray methods, which is really a violation of encapsulation.
I think it also increases code size, especially if nsTArray has virtual methods, because upcasting to the second base class now requires the "this" pointer to be adjusted, and (depending on the compiler) adjuster thunks for the second base class's virtual methods have to be created.
Essentially we're paying that cost so that we can pass an nsPrivateTextRangeList as an nsTArray, which we don't really need or want.
Assignee | ||
Comment 7•18 years ago
|
||
nsTArray doesn't have any virtual methods. That is why I decided inheriting it is ok. And I don't see why all the nsTArray methods shouldn't be exposed, nsPrivateTextRangeList is after all "list". But I'll make a new patch where nsTArray is a member.
Assignee | ||
Comment 8•18 years ago
|
||
Doesn't look quite as nice, mainly because of handling of OOM. DOMEvents really shouldn't allocate memory in their constructor, but that is a different bug.
Attachment #250345 -
Attachment is obsolete: true
Attachment #250437 -
Flags: superreview?(roc)
Attachment #250437 -
Flags: review?(roc)
Attachment #250345 -
Flags: superreview?(roc)
Attachment #250345 -
Flags: review?(masayuki)
I think you should make tempPrivateTextRange an nsRefPtr and not delete it explicitly. I think that in the current patch it will actually be double-deleted because we'll make an nsRefPtr temporary when we try to add it to the array. Anyway we don't want to be relying on whether such a temporary is created or not. I think the same OOM issues were in the previous patch.
Assignee | ||
Comment 10•18 years ago
|
||
Yes, using nsRefPtr makes sense.
Attachment #250437 -
Attachment is obsolete: true
Attachment #250444 -
Flags: superreview?(roc)
Attachment #250444 -
Flags: review?(roc)
Attachment #250437 -
Flags: superreview?(roc)
Attachment #250437 -
Flags: review?(roc)
Attachment #250444 -
Flags: superreview?(roc)
Attachment #250444 -
Flags: superreview+
Attachment #250444 -
Flags: review?(roc)
Attachment #250444 -
Flags: review+
Assignee | ||
Updated•18 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Keywords: inputmethod
You need to log in
before you can comment on or make changes to this bug.
Description
•