Closed
Bug 257220
Opened 21 years ago
Closed 18 years ago
nsAddrDatabase.cpp looks leaky
Categories
(MailNews Core :: Address Book, defect)
MailNews Core
Address Book
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: standard8)
Details
Attachments
(1 file, 1 obsolete file)
|
1.01 KB,
patch
|
Bienvenu
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
I was LXR-ing for NextRow while investigating bug 257218, and I noticed that
nsAddrDatabase.cpp looks like it leaks the result of a bunch of its NextRow
calls as well. I'll attach a patch that I think cleans this up, although I
don't know how to test this code, and I'm also not really sure since I have seen
other similar code that expects input parameters to be AddRef'd.
Also, I noticed that, in nsDBFolderInfo.cpp, only one of AddToNewMDB and
InitFromExistingDB can be called once over the lifetime of the object or it will
leak m_mdbRow.
Also, the patch to nsAddrDatabase that I'll attach adds an XXX comment regarding
unreachable code (due to NS_RELEASE assigning null).
| Reporter | ||
Comment 1•21 years ago
|
||
Comment 2•21 years ago
|
||
David, your patch looks good. Do you want me to run with it to test it and check
it in if its OK?
The unreachable code bothers me - not so much that it's unreachable, since I
don't think you can't have duplicate rows in a table, but I don't see how that
code removes a card from all lists. I'll have to test that out.
re nsDBFolderInfo, it's a singleton so I don't think that's a problem.
| Reporter | ||
Comment 3•21 years ago
|
||
(In reply to comment #2)
> David, your patch looks good. Do you want me to run with it to test it and check
> it in if its OK?
Sure, that would be great.
Updated•21 years ago
|
Product: MailNews → Core
| Reporter | ||
Comment 4•20 years ago
|
||
It looks like the patch to bug 203927 fixed most of the leaks; the patch to
nsAddrDatabase::CheckAndUpdateRecordKey is still valid, though.
| Assignee | ||
Updated•18 years ago
|
Assignee: bienvenu → nobody
Component: MailNews: Database → MailNews: Address Book
QA Contact: addressbook
Comment 6•18 years ago
|
||
(In reply to comment #4)
> the patch to nsAddrDatabase::CheckAndUpdateRecordKey is still valid, though.
from attachment 157243 [details] [diff] [review] the 2 lines to replace are
nsIMdbRow* findRow = nsnull;
and
merror = rowCursor->NextRow(GetEnv(), &findRow, &rowPos);
| Assignee | ||
Comment 7•18 years ago
|
||
I've taken a look at dbaron's patch, and I agree its just nsAddrDatabase::CheckAndUpdateRecordKey leak that is outstanding. I haven't been able to work out how to trigger that function to test (even with playing around with mab files), but I think this will be ok if we ever do run over it.
| Assignee | ||
Comment 8•18 years ago
|
||
Comment on attachment 279508 [details] [diff] [review]
Fix the nsAddrDatabase::CheckAndUpdateRecordKey leak
Opps, looks like I forgot to request reviews...
Attachment #279508 -
Flags: superreview?(bienvenu)
Attachment #279508 -
Flags: review?(bienvenu)
Comment 9•18 years ago
|
||
Comment on attachment 279508 [details] [diff] [review]
Fix the nsAddrDatabase::CheckAndUpdateRecordKey leak
Attachment #279508 -
Flags: superreview?(bienvenu)
Attachment #279508 -
Flags: superreview+
Attachment #279508 -
Flags: review?(bienvenu)
Attachment #279508 -
Flags: review+
| Assignee | ||
Comment 10•18 years ago
|
||
Patch checked in. I believe this bug is fixed now :-)
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•