Closed
Bug 226059
Opened 22 years ago
Closed 22 years ago
nsITransferable* nsClipboard::GetTransferable() returns an addrefed raw pointer
Categories
(Core Graveyard :: GFX, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: caillon, Assigned: caillon)
Details
(Keywords: memory-leak)
Attachments
(1 file)
|
8.62 KB,
patch
|
timeless
:
review+
blizzard
:
superreview+
|
Details | Diff | Splinter Review |
There are four implementations of nsClipboard::GetTransferable(), all of which
return an |nsITransferable*| which has been addrefed. This contributes to at
least one leak:
http://lxr.mozilla.org/mozilla/source/widget/src/xlib/nsClipboard.cpp#188
| Assignee | ||
Comment 1•22 years ago
|
||
Don't addref if you don't advertise it. I left most of the callers keeping
strong pointers though, since it is not clear to me on a quick pass that the
member transferables can't go away in between calls.
| Assignee | ||
Comment 2•22 years ago
|
||
Oops, I meant to point to this with my initial bug comment:
http://lxr.mozilla.org/mozilla/source/widget/src/xlib/nsClipboard.cpp#317
317 NS_IF_RELEASE(mTransferable);
318 mTransferable = GetTransferable(aWhichClipboard);
319 NS_ASSERTION(!mTransferable,"mTransferable is null!! see bug 80181");
320 if (!mTransferable) return NS_ERROR_FAILURE;
321 NS_ADDREF(mTransferable);
| Assignee | ||
Updated•22 years ago
|
Attachment #135793 -
Flags: superreview?(blizzard)
Attachment #135793 -
Flags: review?(bryner)
Updated•22 years ago
|
Severity: normal → critical
Summary: nsITransferable* nsClipboard::GetTransferable() returns an addrefed pointer → nsITransferable* tTransferable() returns an addrefed pointer
| Assignee | ||
Updated•22 years ago
|
Summary: nsITransferable* tTransferable() returns an addrefed pointer → nsITransferable* nsClipboard::GetTransferable() returns an addrefed pointer
Updated•22 years ago
|
Attachment #135793 -
Flags: superreview?(blizzard) → superreview+
Attachment #135793 -
Flags: review?(bryner) → review+
| Assignee | ||
Comment 3•22 years ago
|
||
Checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Summary: nsITransferable* nsClipboard::GetTransferable() returns an addrefed pointer → nsITransferable* nsClipboard::GetTransferable() returns an addrefed raw pointer
Updated•17 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•