Closed Bug 265414 Opened 20 years ago Closed 20 years ago

###!!! ASSERTION: You are calling CreateInstance "{fbc81170-1f69-11d3-9344-00104ba0fd40}" when a service for this CID already exists!: 'Error', file r:/mozilla/xpcom/components/nsComponentManager.cpp, line 1880

Categories

(Other Applications :: ChatZilla, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: timeless, Assigned: bugzilla-mozilla-20000923)

Details

Attachments

(1 file, 2 obsolete files)

###!!! ASSERTION: You are calling CreateInstance
"{fbc81170-1f69-11d3-9344-00104ba0fd40}" when a service for this CID already
exists!: 'Error', file r:/mozilla/xpcom/components/nsComponentManager.cpp, line 1880
Break: at file r:/mozilla/xpcom/components/nsComponentManager.cpp, line 1880
0 [native frame]
1 getFileFromURLSpec(url = "file:///C:/DOCUMENTSAND               
ETTINGS/xxxx/APPLICATIONDATA/Mozi
lla/Profiles/zzzzzz/pxf3204n.slt/chatzilla/scripts/")
["chrome://chatzilla/content/lib/js/utils.js":
855]
    FILE_CTRID = "@mozilla.org/network/protocol;1?name=file"
    nsIFileProtocolHandler = nsIFileProtocolHandler
    handler = undefined
    this = [object ChromeWindow @ 0x3c3bc78]
2 processStartupScripts() ["chrome://chatzilla/content/static.js":412]
    scripts = file:///C:/DOCUMENTSAND0 [native frame]
1 getFileFromURLSpec(url = "file:///C:/DOCUMENTSAND               
ETTINGS/xxxx/APPLICATIONDATA/Mozi
lla/Profiles/zzzzzz/pxf3204n.slt/chatzilla/scripts/")
["chrome://chatzilla/content/lib/js/utils.js":
855]
    FILE_CTRID = "@mozilla.org/network/protocol;1?name=file"
    nsIFileProtocolHandler = nsIFileProtocolHandler
    handler = undefined
    this = [object ChromeWindow @ 0x3c3bc78]
2 processStartupScripts() ["chrome://chatzilla/content/static.js":412]
    scripts = file:///C:/DOCUMENTSAND

yes, DumpJSStack corrupted my stack, it's ok, the problem is frame 1. protocol
handlers are services, they're not supposed to be created.
Oooh, nice one (oops!).
Attachment #162837 - Flags: review?(rginda)
That just takes longer... is there actually any reason to use it?

I notice that network.protocol-handler.external.file would block this (there
also seems to be some other blocking going on that I don't understand) and
probably screw everything up, so I think I'd rather stick to what we know works.

getURLSpecFromFile would suffer from such blocking already, it seems...
> I notice that network.protocol-handler.external.file would block this 

that pref likely screws up starting mozilla....
Attached patch nsIIOService version (obsolete) — Splinter Review
Attachment #162837 - Attachment is obsolete: true
Attachment #162837 - Flags: review?(rginda)
Attachment #162848 - Flags: review?(rginda)
Comment on attachment 162848 [details] [diff] [review]
nsIIOService version

the getService method takes an option reference to the interface you'd like. 
That avoids the extra QueryInterface call.  Other than that, it looks fine.

r=rginda
Attachment #162848 - Flags: review?(rginda) → review+
Comment on attachment 162848 [details] [diff] [review]
nsIIOService version

>Index: js/lib/utils.js

>+        case "object":
>+            rv = obj.QueryInterface[iface];

shouldn't this be: obj.QueryInterface(iface); ??
(In reply to comment #8)
> (From update of attachment 162848 [details] [diff] [review])
> >Index: js/lib/utils.js
> 
> >+        case "object":
> >+            rv = obj.QueryInterface[iface];
> 
> shouldn't this be: obj.QueryInterface(iface); ??

I did wonder that, but this procedure is copy-and-paste from the existing
"newObject" procedure that does createInstance() on things.

rginda? Should I re-do both these functions?
> rginda? Should I re-do both these functions?

Sounds good.  You shouldn't need QueryInterface at all, if you pass the
requested interface to the getService() (or createInstance()) call.
Attachment #162848 - Attachment is obsolete: true
Attachment #162848 - Flags: review+
Comment on attachment 163077 [details] [diff] [review]
Update newObject/getService to use short forms without specific QI

I added the ability to call these two functions without a third parameter in
case it's useful.
Attachment #163077 - Flags: review?(rginda)
Comment on attachment 163077 [details] [diff] [review]
Update newObject/getService to use short forms without specific QI

r=rginda
Attachment #163077 - Flags: review?(rginda) → review+
Assignee: rginda → silver
Checked in --> FIXED.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Other Applications
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: