FreeJavaGlobals(env);
XPCOM_NATIVE(shutdownXPCOM) (JNIEnv *env, jclass, jobject aServMgr){  nsresult rv;  nsCOMPtr<nsIServiceManager> servMgr;  if (aServMgr) {    // Get native XPCOM instance    void* xpcom_obj;    rv = GetXPCOMInstFromProxy(env, aServMgr, &xpcom_obj);    NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to get XPCOM obj for ServiceMgr.");    // Even if we failed to get the matching xpcom object, we don't abort this    // function.  Just call NS_ShutdownXPCOM with a null service manager.    if (NS_SUCCEEDED(rv)) {      JavaXPCOMInstance* inst = NS_STATIC_CAST(JavaXPCOMInstance*, xpcom_obj);      servMgr = do_QueryInterface(inst->GetInstance());    }  }  rv = NS_ShutdownXPCOM(servMgr);  if (NS_FAILED(rv))    ThrowException(env, rv, "NS_ShutdownXPCOM failed");  FreeJavaGlobals(env);}