Closed
Bug 47134
Opened 24 years ago
Closed 24 years ago
nsProxy needs to proxy Release()
Categories
(Core :: XPConnect, defect, P3)
Tracking
()
RESOLVED
FIXED
M18
People
(Reporter: alecf, Assigned: dougt)
References
Details
(Keywords: arch, Whiteboard: [nsbeta3+])
Attachments
(1 file)
14.75 KB,
patch
|
Details | Diff | Splinter Review |
as per a short discussion on n.p.m.xpcom, the XPCOM proxy system needs to automatically proxy release, so that the destructor for a proxied object does not happen on the wrong thread. Per doug, this needs to happen much like the way QI works: http://lxr.mozilla.org/seamonkey/source/xpcom/proxy/src/nsProxyEventObject.cpp#344 I looked into doing this myself, and it's kinda complicated.
Reporter | ||
Comment 1•24 years ago
|
||
nominate for nsbeta3, add arch keyword
Comment 2•24 years ago
|
||
adding mlk keyword (remove it if I'm wrong) and plussing.
Whiteboard: [nsbeta3+]
Reporter | ||
Comment 3•24 years ago
|
||
not quite an mlk, but it's pretty bad (calling the destructor on the wrong thread)
Updated•24 years ago
|
Target Milestone: --- → M18
Reporter | ||
Comment 5•24 years ago
|
||
this duped bug is the bug that first brought my attention to this issue..
Assignee | ||
Comment 6•24 years ago
|
||
AddRef'ing and Release'ing always can happen on different threads. I don't think that this is a problem. You should be using THREADSAFE nsISupports when proxying. The refcounting is a limition of the ownership model we have. I need to make sure that the object does not go away when we put it in an eventQ. I am not going change this. However, the deletion of the object must happen on the destination q - always, always, always. I have added a special Release to the nsProxyObject which will post an event to the destination eventQ when the refcount hits zero. When handled, the event will delete the object. I have tested this, and the I can not reproduce the above bug. Attaching the diff next. I need someone to review it.
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
fix is in. qa, verify against bug 41958
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 9•24 years ago
|
||
thanks doug, this is awesome (and as a bonus I'll bet this means less assertions if I ^C on windows)
Assignee | ||
Comment 10•24 years ago
|
||
please let me know. But note, that your object that you are proxing should have a threadsafe nsISupports.... maybe I should test for this in debug builds???
Reporter | ||
Comment 11•24 years ago
|
||
I thought warren had a check for this already? I think that any proxied AddRef will assert, so it would be easy to catch this..
Assignee | ||
Comment 12•24 years ago
|
||
yes, exactly. lets just go with the generic assertion. Maybe I should fail to create a proxy in your isupport is not thread safe?
Reporter | ||
Comment 13•24 years ago
|
||
I think the assertion is good enough, esp because it only affects debug builds.. It's already there too :)
You need to log in
before you can comment on or make changes to this bug.
Description
•