Add missing calls to PR_UnloadLibrary (excluding XPCOM component loader and nsPluginsDir*). b=374332 r=bsmedberg
git-svn-id: svn://10.0.0.236/trunk@224556 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -103,7 +103,7 @@ static const char *gssFuncStr[] = {
|
||||
|
||||
static PRFuncPtr gssFunPtr[gssFuncItems];
|
||||
static PRBool gssNativeImp = PR_TRUE;
|
||||
static PRBool gssFunInit = PR_FALSE;
|
||||
static PRLibrary* gssLibrary = nsnull;
|
||||
|
||||
#define gss_display_status_ptr ((gss_display_status_type)*gssFunPtr[0])
|
||||
#define gss_init_sec_context_ptr ((gss_init_sec_context_type)*gssFunPtr[1])
|
||||
@@ -223,7 +223,7 @@ gssInit()
|
||||
}
|
||||
#endif
|
||||
|
||||
gssFunInit = PR_TRUE;
|
||||
gssLibrary = lib;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char *prefix)
|
||||
nsCAutoString errorStr;
|
||||
errorStr.Assign(prefix);
|
||||
|
||||
if (!gssFunInit)
|
||||
if (!gssLibrary)
|
||||
return;
|
||||
|
||||
errorStr += ": ";
|
||||
@@ -296,7 +296,7 @@ nsAuthGSSAPI::nsAuthGSSAPI(pType package)
|
||||
|
||||
mComplete = PR_FALSE;
|
||||
|
||||
if (!gssFunInit && NS_FAILED(gssInit()))
|
||||
if (!gssLibrary && NS_FAILED(gssInit()))
|
||||
return;
|
||||
|
||||
mCtx = GSS_C_NO_CONTEXT;
|
||||
@@ -340,7 +340,7 @@ nsAuthGSSAPI::nsAuthGSSAPI(pType package)
|
||||
void
|
||||
nsAuthGSSAPI::Reset()
|
||||
{
|
||||
if (gssFunInit && mCtx != GSS_C_NO_CONTEXT) {
|
||||
if (gssLibrary && mCtx != GSS_C_NO_CONTEXT) {
|
||||
OM_uint32 minor_status;
|
||||
gss_delete_sec_context_ptr(&minor_status, &mCtx, GSS_C_NO_BUFFER);
|
||||
}
|
||||
@@ -348,6 +348,15 @@ nsAuthGSSAPI::Reset()
|
||||
mComplete = PR_FALSE;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsAuthGSSAPI::Shutdown()
|
||||
{
|
||||
if (gssLibrary) {
|
||||
PR_UnloadLibrary(gssLibrary);
|
||||
gssLibrary = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsAuthGSSAPI, nsIAuthModule)
|
||||
|
||||
NS_IMETHODIMP
|
||||
@@ -365,7 +374,7 @@ nsAuthGSSAPI::Init(const char *serviceName,
|
||||
|
||||
LOG(("entering nsAuthGSSAPI::Init()\n"));
|
||||
|
||||
if (!gssFunInit)
|
||||
if (!gssLibrary)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
mServiceName = serviceName;
|
||||
@@ -390,7 +399,7 @@ nsAuthGSSAPI::GetNextToken(const void *inToken,
|
||||
|
||||
LOG(("entering nsAuthGSSAPI::GetNextToken()\n"));
|
||||
|
||||
if (!gssFunInit)
|
||||
if (!gssLibrary)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
// If they've called us again after we're complete, reset to start afresh.
|
||||
|
||||
Reference in New Issue
Block a user