PR_Unlock(tempLock); PR_DestroyLock(tempLock);
if (tempLock) { PR_Unlock(tempLock); PR_DestroyLock(tempLock); }
FreeJavaGlobals(JNIEnv* env){  PR_Lock(gJavaXPCOMLock);  // null out global lock so no one else can use it  PRLock* tempLock = gJavaXPCOMLock;  gJavaXPCOMLock = nsnull;  gJavaXPCOMInitialized = PR_FALSE;  // Free the mappings first, since that process depends on some of the Java  // globals that are freed later.  if (gNativeToJavaProxyMap) {    gNativeToJavaProxyMap->Destroy(env);    delete gNativeToJavaProxyMap;    gNativeToJavaProxyMap = nsnull;  }  if (gJavaToXPTCStubMap) {    gJavaToXPTCStubMap->Destroy();    delete gJavaToXPTCStubMap;    gJavaToXPTCStubMap = nsnull;  }  // Free remaining Java globals  if (booleanClass) {    env->DeleteGlobalRef(booleanClass);    booleanClass = nsnull;  }  if (charClass) {    env->DeleteGlobalRef(charClass);    charClass = nsnull;  }  if (byteClass) {    env->DeleteGlobalRef(byteClass);    byteClass = nsnull;  }  if (shortClass) {    env->DeleteGlobalRef(shortClass);    shortClass = nsnull;  }  if (intClass) {    env->DeleteGlobalRef(intClass);    intClass = nsnull;  }  if (longClass) {    env->DeleteGlobalRef(longClass);    longClass = nsnull;  }  if (floatClass) {    env->DeleteGlobalRef(floatClass);    floatClass = nsnull;  }  if (doubleClass) {    env->DeleteGlobalRef(doubleClass);    doubleClass = nsnull;  }  if (stringClass) {    env->DeleteGlobalRef(stringClass);    stringClass = nsnull;  }  if (nsISupportsClass) {    env->DeleteGlobalRef(nsISupportsClass);    nsISupportsClass = nsnull;  }  if (xpcomExceptionClass) {    env->DeleteGlobalRef(xpcomExceptionClass);    xpcomExceptionClass = nsnull;  }  if (xpcomJavaProxyClass) {    env->DeleteGlobalRef(xpcomJavaProxyClass);    xpcomJavaProxyClass = nsnull;  }  PR_Unlock(tempLock);  PR_DestroyLock(tempLock);}