Closed Bug 327716 Opened 19 years ago Closed 19 years ago

XPC_NW_NewResolve should root its cloned function object

Categories

(Core :: XPConnect, defect, P1)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: fixed1.8.0.4, fixed1.8.1, Whiteboard: [patch])

Attachments

(1 file)

XPC_NW_NewResolve clones a function object and passes it to WrapFunction, which creates another function, which means the first one can be destroyed:

js_GC (/builds/trunk/mozilla/js/src/jsgc.c:1947)
js_NewGCThing (/builds/trunk/mozilla/js/src/jsgc.c:635)
js_NewObject (/builds/trunk/mozilla/js/src/jsobj.c:2008)
js_NewFunction (/builds/trunk/mozilla/js/src/jsfun.c:2030)
JS_NewFunction (/builds/trunk/mozilla/js/src/jsapi.c:3403)
WrapFunction (/builds/trunk/mozilla/js/src/xpconnect/src/XPCNativeWrapper.cpp:236)
XPC_NW_NewResolve (/builds/trunk/mozilla/js/src/xpconnect/src/XPCNativeWrapper.cpp:860)
Attached patch possible patchSplinter Review
Not sure whether this is the best approach, but it works.
Attachment #212311 - Flags: review?(jst)
Assignee: dbradley → dbaron
Priority: -- → P1
Whiteboard: [patch]
Comment on attachment 212311 [details] [diff] [review]
possible patch

Sure, that will work and seems necessary in general (alas).

Again it might be better to root as soon as possible, so even before the DEBUG_XPCNativeWrapper paragraph.

/be
Attachment #212311 - Flags: superreview?(brendan) → superreview+
Comment on attachment 212311 [details] [diff] [review]
possible patch

r=jst
Attachment #212311 - Flags: review?(jst) → review+
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Attachment #212311 - Flags: approval1.8.0.3?
Attachment #212311 - Flags: approval-branch-1.8.1?(jst)
Attachment #212311 - Flags: approval-branch-1.8.1?(jst) → approval-branch-1.8.1+
Checked in to MOZILLA_1_8_BRANCH.
Keywords: fixed1.8.1
Comment on attachment 212311 [details] [diff] [review]
possible patch

Please check in promptly on the 1.8.0 branch.  Thanks!
Attachment #212311 - Flags: approval1.8.0.3? → approval1.8.0.3+
Fix checked in to MOZILLA_1_8_0_BRANCH.
Keywords: fixed1.8.0.3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: