Remove nsJavaXPTCStub from hash table on destruction. Fix ref counting. Clean up logging. Not part of default build.

git-svn-id: svn://10.0.0.236/trunk@162389 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pedemont%us.ibm.com
2004-09-15 19:21:08 +00:00
parent d0656e8867
commit 2f0ba6e0db
5 changed files with 57 additions and 30 deletions

View File

@@ -340,7 +340,6 @@ SetupParams(JNIEnv *env, const jobject aParam,
// Create XPCOM stub
nsJavaXPTCStub* xpcomStub = new nsJavaXPTCStub(env, data, iinfo);
NS_ADDREF(xpcomStub);
inst = SetAsXPTCStub(xpcomStub);
AddJavaXPCOMBinding(env, data, inst);
}
@@ -371,9 +370,11 @@ SetupParams(JNIEnv *env, const jobject aParam,
}
#endif
if (IsXPTCStub(inst))
aVariant.val.p = aVariant.ptr = (void*) GetXPTCStubAddr(inst);
else {
if (IsXPTCStub(inst)) {
nsJavaXPTCStub* xpcomStub = GetXPTCStubAddr(inst);
NS_ADDREF(xpcomStub);
aVariant.val.p = aVariant.ptr = (void*) xpcomStub;
} else {
JavaXPCOMInstance* xpcomInst = (JavaXPCOMInstance*) inst;
aVariant.val.p = aVariant.ptr = (void*) xpcomInst->GetInstance();
}
@@ -654,7 +655,7 @@ FinalizeParams(JNIEnv *env, const jobject aParam,
case nsXPTType::T_INTERFACE_IS:
{
if (aVariant.val.p && aParamInfo.IsOut()) {
jobject java_obj = GetMatchingJavaObject(aVariant.val.p);
jobject java_obj = GetMatchingJavaObject(env, aVariant.val.p);
if (java_obj == nsnull) {
// wrap xpcom instance