Closed
Bug 671625
Opened 14 years ago
Closed 14 years ago
AddDefaultGateway does not check gateway for validity
Categories
(Other Applications Graveyard :: PyXPCOM, defect)
Other Applications Graveyard
PyXPCOM
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mark.yen, Assigned: mark.yen)
Details
Attachments
(1 file, 1 obsolete file)
|
5.82 KB,
patch
|
twhitema
:
review+
|
Details | Diff | Splinter Review |
AddDefaultGateway does not ensure that the gateway is still alive, just that the object has an attribute of the right name. This means that, for a python object O implementing interface I, if you
1) Get a O -> I wrapper,
2) Release it (so the wrapper dies),
3) Get a new O -> I wrapper,
O will still think it has a default gateway (that is long dead), instead of the new one.
See attached patch.
For more concrete STR, grab a debug build of Komodo, set it to open nothing on startup (not even the start page), then restart, and open a recent project from the menu. It aborts in PyG_Base::AutoWrapPythonInstance with a koProject with "Auto-wrapped object didn't get a default gateway!".
Attachment #545966 -
Flags: review?(toddw)
| Assignee | ||
Updated•14 years ago
|
Attachment #545966 -
Attachment is patch: true
Comment 1•14 years ago
|
||
Is there a test case that can be added to check this?
| Assignee | ||
Comment 2•14 years ago
|
||
Turns out it involves wrapping the object during repr() (in the koProject case, ultimately it tried to add itself as an observer to the pref observer service in __repr__).
Assignee: nobody → marky
Attachment #545966 -
Attachment is obsolete: true
Attachment #546816 -
Flags: review?(toddw)
Attachment #545966 -
Flags: review?(toddw)
Comment 3•14 years ago
|
||
Comment on attachment 546816 [details] [diff] [review]
now with a test
Committed in:
http://hg.mozilla.org/pyxpcom/rev/b2c1ad354b91
Attachment #546816 -
Flags: review?(toddw) → review+
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 4•14 years ago
|
||
There was a missing "PyErr_Clear();" for the PyObject_GetAttrString call, to clear the exception when there was no "PyXPCOM_szDefaultGatewayAttributeName" attribute set on the object.
Added in change:
http://hg.mozilla.org/pyxpcom/rev/2cce3102916e
Updated•7 years ago
|
Product: Other Applications → Other Applications Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•