QI, don't case! Not part of default build.
Original committer: pedemont%us.ibm.com Original revision: 1.3 Original date: 2004/09/15 19:47:19 git-svn-id: svn://10.0.0.236/trunk@212559 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2ab5ff0a6f
commit
e29bdc8e23
@ -175,17 +175,19 @@ RemoveXPCOMBinding(JNIEnv* env, jobject aJavaObject)
|
||||
LOG("- Removing Java<->XPCOM binding (Java=0x%08x | XPCOM=0x%08x)\n",
|
||||
hash, (int) xpcomObj);
|
||||
|
||||
nsISupports* inst = nsnull;
|
||||
if (IsXPTCStub(xpcomObj)) {
|
||||
return (nsISupports*) GetXPTCStubAddr(xpcomObj);
|
||||
GetXPTCStubAddr(xpcomObj)->QueryInterface(NS_GET_IID(nsISupports),
|
||||
(void**) &inst);
|
||||
} else {
|
||||
JavaXPCOMInstance* xpcomInst = (JavaXPCOMInstance*) xpcomObj;
|
||||
nsISupports* inst = xpcomInst->GetInstance();
|
||||
inst = xpcomInst->GetInstance();
|
||||
// XXX Getting some odd thread issues when calling this. Addreffing for
|
||||
// now to work around the errors.
|
||||
NS_ADDREF(inst);
|
||||
delete xpcomInst;
|
||||
return inst;
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
#ifdef DEBUG_pedemonte
|
||||
#define LOG(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG(format, ...)
|
||||
#define LOG(...) /* nothing */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -101,12 +101,12 @@ private:
|
||||
inline void* SetAsXPTCStub(nsJavaXPTCStub* ptr)
|
||||
{ NS_PRECONDITION(ptr, "null pointer");
|
||||
return (void*) (((unsigned long) ptr) | 0x1); }
|
||||
|
||||
inline PRBool IsXPTCStub(void* ptr)
|
||||
|
||||
inline PRBool IsXPTCStub(void* ptr)
|
||||
{ NS_PRECONDITION(ptr, "null pointer");
|
||||
return ((unsigned long) ptr) & 0x1; }
|
||||
|
||||
inline nsJavaXPTCStub* GetXPTCStubAddr(void* ptr)
|
||||
|
||||
inline nsJavaXPTCStub* GetXPTCStubAddr(void* ptr)
|
||||
{ NS_PRECONDITION(ptr, "null pointer");
|
||||
return (nsJavaXPTCStub*) (((unsigned long) ptr) & ~0x1); }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user