Closed Bug 20181 Opened 25 years ago Closed 25 years ago

[MLK] Leaking nsJISx4501LineBreaker

Categories

(Core Graveyard :: RDF, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: beard, Assigned: ftang)

References

()

Details

When using an nsCOMPtr<nsILineBreaker>, simply assigning to it causes another
AddRef() to be called on the interface being assigned. However, the line above
returns an object which already has a refCount of 1, so the object leaks. The fix
is as follows:

Index: mozilla/rdf/content/src/nsXULDocument.cpp
===================================================================
RCS file: /cvsroot/mozilla/rdf/content/src/nsXULDocument.cpp,v
retrieving revision 1.204
diff -r1.204 nsXULDocument.cpp
722c722
<          mLineBreaker = lb;
---
>          mLineBreaker = dont_AddRef(lb);
Target Milestone: M12
same for word breaker
I copy the code from layout/base/src/nsDocument.cpp . howerver, in there, the pointer is not nsCOMPtr so we should only fix
this place.
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
fix and check in.
verified
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.