NS_InitXPCOM2 has unused argument

RESOLVED FIXED in mozilla0.9.5

Status

()

RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: adamlock, Assigned: dougt)

Tracking

Trunk
mozilla0.9.5
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
The first argument of NS_InitXPCOM2 is supposed to return with a pointer to an
nsIServiceManager object. NS_InitXPCOM2 does nothing with it at all. Either it
should be fixed to return something or the argument should be removed (and in
NS_ShutdownXPCOM).

I think it's probably obselete, right?
(Assignee)

Comment 1

17 years ago
Sorry about that:

Index: mozilla/xpcom/build/nsXPComInit.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpcom/build/nsXPComInit.cpp,v
retrieving revision 1.101
diff -u -2 -r1.101 nsXPComInit.cpp
--- nsXPComInit.cpp	2001/09/06 21:12:52	1.101
+++ nsXPComInit.cpp	2001/09/07 21:26:37
@@ -342,4 +342,8 @@
         gServiceManager = NS_STATIC_CAST(nsIServiceManager*, compMgr);
         nsComponentManagerImpl::gComponentManager = compMgr;
+        
+        if (result) {
+        	NS_ADDREF(*result = servMgr);
+        }
     }
 


Adam, could you review this change??
Keywords: patch
Target Milestone: --- → mozilla0.9.5
(Reporter)

Comment 2

17 years ago
r=adamlock assuming the assignment within a macro is a safe operation.

But is this argument even needed anymore? Is there any legitimate reason the
caller would want a service manager pointer to be returned from NS_InitXPCOM?
(Assignee)

Comment 3

17 years ago
Sure, it may want to cache it so that you do not have to link to xpcom to get
the service manager.

Rick, can I get some sr love?

Comment 4

17 years ago
hey doug,

Do you have some local mods in your tree?  It looks like 'servMgr' should be 
'gServiceManager'.  I don't see a 'servMgr' variable in NS_InitXPCOM2(...)

Or is this just a test to see if i really *do* look at patches ;-)

sr=rpotts if you fix up 'servMgr' :-)

-- rick
(Assignee)

Comment 5

17 years ago
Checking in nsXPComInit.cpp;
/cvsroot/mozilla/xpcom/build/nsXPComInit.cpp,v  <--  nsXPComInit.cpp
new revision: 1.102; previous revision: 1.101
done
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.