Closed Bug 459165 Opened 18 years ago Closed 17 years ago

Use the contextCallback in XPConnect

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 408539

People

(Reporter: mrbkap, Unassigned)

Details

XPConnect tries to keep a list of XPCContexts in sync with their corresponding JSContexts. Currently, it doesn't use the contextCreated callback and has to rely on noticing a JSContext without an associated XPCContext. Because there is no contextDestroyed callback, we occasionally run some code to reap "stale" XPCContexts. This can be expensive with lots of contexts and provides a gap where we might try to use a dead JSContext through its XPCContext. Providing a contextDestroyed callback would solve this.
JS_PUBLIC_API(JSContextCallback) JS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback) has been there for a while. /be
Assignee: general → nobody
Component: JavaScript Engine → XPConnect
QA Contact: general → xpconnect
See also bug 408539 - I think this bug is a dup of that, isn't it?
Wow. I'm clearly batting 0 for 2 here. This is a dupe of bug 408539. On the other hand, I think we want to backport the fix for this bug to stable branches (I filed this in response to a topcrasher pointed out by Ben Turner) and that patch is rather big to do so.
Summary: Provide a contextDestroyed callback → Use the contextCallback in XPConnect
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.