Components.utils.getWeakReference gets a weak ref to the JSObject, even when the underlying native supports weak references.

RESOLVED FIXED in mozilla14

Status

()

Core
XPConnect
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

({dev-doc-needed})

unspecified
mozilla14
dev-doc-needed
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I think that the right behavior here is to get a weak ref to the underlying native if the object passed in is a wrapper and the native object supports weak references.  Blake, Bobby?
Yeah, I think the current behavior is a bug. Please do fix it.
Created attachment 593069 [details] [diff] [review]
Patch

There is one tricky bit here, which is that after doing weakref.get() you need to QI whatever interfaces you want again.  I don't know that there's an easy way to fix that.
Attachment #593069 - Flags: review?(mrbkap)

Updated

6 years ago
Attachment #593069 - Flags: review?(mrbkap) → review+
http://hg.mozilla.org/mozilla-central/rev/447ede53509a
Assignee: nobody → khuey
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.