Bug 384639 - Adding option to disable library unloading also in optimized build.

r=nelson


git-svn-id: svn://10.0.0.236/trunk@237458 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
slavomir.katuscak%sun.com 2007-10-09 17:06:25 +00:00
parent ccb4979513
commit a66d8cc0dd
8 changed files with 8 additions and 24 deletions

View File

@ -903,9 +903,7 @@ cleanup:
#ifdef _WIN32
FreeLibrary(hModule);
#else
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (!disableUnload) {
PR_UnloadLibrary(lib);
}

View File

@ -1430,9 +1430,7 @@ unloadModule(Module *module)
{
char *disableUnload = NULL;
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (module->library && !disableUnload) {
PR_UnloadLibrary(module->library);

View File

@ -35,7 +35,7 @@
* ***** END LICENSE BLOCK ***** */
#ifdef DEBUG
static const char CVS_ID[] = "@(#) $RCSfile: devmod.c,v $ $Revision: 1.8 $ $Date: 2007-07-24 08:56:39 $";
static const char CVS_ID[] = "@(#) $RCSfile: devmod.c,v $ $Revision: 1.9 $ $Date: 2007-10-09 17:06:22 $";
#endif /* DEBUG */
#ifndef NSSCKEPV_H
@ -306,9 +306,7 @@ nssModule_Unload (
char *disableUnload = NULL;
if (mod->library) {
(void)CKAPI(mod->epv)->C_Finalize(NULL);
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (!disableUnload) {
nssrv = PR_UnloadLibrary(mod->library);
}

View File

@ -37,7 +37,7 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* $Id: loader.c,v 1.35 2007-07-24 14:36:57 slavomir.katuscak%sun.com Exp $ */
/* $Id: loader.c,v 1.36 2007-10-09 17:06:22 slavomir.katuscak%sun.com Exp $ */
#include "loader.h"
#include "prmem.h"
@ -855,9 +855,7 @@ BL_Unload(void)
* never does a handshake on it, BL_Unload will be called even though freebl
* was never loaded. So, don't assert blLib. */
if (blLib) {
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (!disableUnload) {
PRStatus status = PR_UnloadLibrary(blLib);
PORT_Assert(PR_SUCCESS == status);

View File

@ -445,9 +445,7 @@ fail2:
}
fail:
mod->functionList = NULL;
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (library && !disableUnload) {
PR_UnloadLibrary(library);
}
@ -474,9 +472,7 @@ SECMOD_UnloadModule(SECMODModule *mod) {
if (mod->internal) {
if (0 == PR_AtomicDecrement(&softokenLoadCount)) {
if (softokenLib) {
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (!disableUnload) {
PRStatus status = PR_UnloadLibrary(softokenLib);
PORT_Assert(PR_SUCCESS == status);
@ -494,9 +490,7 @@ SECMOD_UnloadModule(SECMODModule *mod) {
return SECFailure;
}
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (!disableUnload) {
PR_UnloadLibrary(library);
}

View File

@ -36,7 +36,7 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* $Id: lginit.c,v 1.10 2007-08-09 22:36:19 rrelyea%redhat.com Exp $ */
/* $Id: lginit.c,v 1.11 2007-10-09 17:06:24 slavomir.katuscak%sun.com Exp $ */
#include "lowkeyi.h"
#include "pcert.h"
@ -187,9 +187,7 @@ DB * rdbopen(const char *appName, const char *prefix,
}
/* couldn't find the entry point, unload the library and fail */
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (!disableUnload) {
PR_UnloadLibrary(lib);
}

View File

@ -410,9 +410,7 @@ sftkdbCall_Shutdown(void)
if (legacy_glue_shutdown) {
crv = (*legacy_glue_shutdown)();
}
#ifdef DEBUG
disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD");
#endif
if (!disableUnload) {
PR_UnloadLibrary(legacy_glue_lib);
}

View File

@ -170,13 +170,13 @@ memleak_init()
if [ "${BUILD_OPT}" -eq "1" ] ; then
OPT="OPT"
unset NSS_DISABLE_UNLOAD
else
OPT="DBG"
NSS_DISABLE_UNLOAD="1"
export NSS_DISABLE_UNLOAD
fi
NSS_DISABLE_UNLOAD="1"
export NSS_DISABLE_UNLOAD
SELFSERV_ATTR="-D -p ${PORT} -d ${SERVER_DB} -n ${HOSTADDR} -e ${HOSTADDR}-ec -w nss -c ABCDEF:C001:C002:C003:C004:C005:C006:C007:C008:C009:C00A:C00B:C00C:C00D:C00E:C00F:C010:C011:C012:C013:C014cdefgijklmnvyz -t 5"
TSTCLNT_ATTR="-p ${PORT} -h ${HOSTADDR} -c j -f -d ${CLIENT_DB} -w nss"
@ -194,6 +194,8 @@ memleak_init()
memleak_cleanup()
{
unset MEMLEAK_DBG
unset NSS_DISABLE_UNLOAD
. ${QADIR}/common/cleanup.sh
}