Closed Bug 8248 Opened 25 years ago Closed 25 years ago

XPConnect does not release wrapped C++ interfaces

Categories

(Core :: XPConnect, defect, P3)

All
Mac System 8.5
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sfraser_bugs, Assigned: jband_mozilla)

Details

XPCOM objects created in JS are not being released on garbage collection of their holding objects. For example, in the xpcom/sample example, we create an instance of the sample object thusly: var sample = Components.classes["component://netscape/sample/sample- world"].createInstance(); sample = sample.QueryInterface(Components.interfaces.nsISample); but when you leave the page, or close the window, the sample instance in C++ never gets destroyed.
Blocks: 5806
Status: NEW → ASSIGNED
Funny, I believe that this used to work right. I'm on it. I'm setting up some test classes and I'll work this out.
Adding myself and Mike Ang to the cc list.
jband, you checked in what looked like a fix for this today, but I'm still seeing the problem. Should I be?
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
I'm marking this fixed. Reopen as necessary... I fixed a bug that would certainly cause this problem. The test code I've been playing with makes xpconnect look clean. I just ran the sample in question and it works for me. I set breakpoints in SampleImpl's ctor and dtor. I go to the page and the ctor gets called. I go somewhere else and the dtor gets called. Somtimes I need to navigate a little further before the dtor gets called, but that's gc for you. If it's not working for you, then I'd like to hear more.
No longer blocks: 5806
I can verify that this is fixed; I see the sample objbect being destroyed.
So Simon Fraser, Should I mark it verified ?
Yes.
Status: RESOLVED → VERIFIED
Marking this bug as verified. Thanx Simon.
You need to log in before you can comment on or make changes to this bug.