Closed Bug 24876 Opened 26 years ago Closed 26 years ago

Don't use |nsCOMPtr| on non-interfaces

Categories

(Core :: Networking: Cache, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: scc-obsolete, Assigned: gagan)

References

()

Details

There are two occurances of |nsCOMPtr<nsCachedNetData>|. You can't do that! You can't use an |nsCOMPtr| on a non-interface, i.e., you should be using |nsCOMPtr< nsICachedNetData>| here. One downside of the current code is that it is stopping some people from compiling, e.g., Ciaran.Deignan@bull.net whose compiler reports: "../../../dist/include/nsCOMPtr.h", line 191.3: 1540-016: (S) private member "nsCachedNetData::nsCachedNetData()" cannot be accessed. The two occurances are currently at: <http://lxr.mozilla.org/seamonkey/source/netwerk/cache/mgr/ nsCachedNetData.cpp#117>, and <http://lxr.mozilla.org/seamonkey/source/netwerk/cache/mgr/ nsCachedNetData.cpp#1144>
I don't think the nsCOMPtr was needed there... cleaned up.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
I saw your modifications at lines 117 and 1144 of nsCachedNetData.ccp and I manually integrated them into my source file. However I now have the same problem again at line 191: "../../../dist/include/nsCOMPtr.h", line 191.3: 1540-016: (S) private member "nsCachedNetData::nsCachedNetData()" cannot be accessed. Line 191 is as follows: +189 NS_IMPL_ADDREF(nsCachedNetData) +190 NS_IMETHODIMP +191 nsCachedNetData::QueryInterface(REFNSIID aIID, void** aInstancePtr) +192 { +193 NS_ASSERTION(aInstancePtr, "QueryInterface requires a non-NULL dest$ I upgraded my compiler, I am now using ibmcxxx 3.6.6. I don't think its worse, but it ain't better... Thanks Ciaran
Status: RESOLVED → REOPENED
Clearing FIXED resolution due to reopen.
Resolution: FIXED → ---
This error means someone is still using an |nsCOMPtr<nsCachedNetData>| object somewhere.
ciaran.deignan@bull.net: I can't seem to locate that problem in my builds, could you try and update the mozilla/netwerk/cache dir and verify? Thx.
cc'ing new cache owners.
Tested with M13 distribution, this error no longer appears
Status: REOPENED → RESOLVED
Closed: 26 years ago → 26 years ago
Resolution: --- → FIXED
verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.