OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 /* | 4 /* |
5 * pkix_pl_lifecycle.c | 5 * pkix_pl_lifecycle.c |
6 * | 6 * |
7 * Lifecycle Functions for the PKIX PL library. | 7 * Lifecycle Functions for the PKIX PL library. |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 */ | 128 */ |
129 if (pkix_pl_initialized) { | 129 if (pkix_pl_initialized) { |
130 PKIX_RETURN(OBJECT); | 130 PKIX_RETURN(OBJECT); |
131 } | 131 } |
132 | 132 |
133 classTableLock = PR_NewLock(); | 133 classTableLock = PR_NewLock(); |
134 if (classTableLock == NULL) { | 134 if (classTableLock == NULL) { |
135 return PKIX_ALLOC_ERROR(); | 135 return PKIX_ALLOC_ERROR(); |
136 } | 136 } |
137 | 137 |
138 if (PR_GetEnv("NSS_STRICT_SHUTDOWN")) { | 138 if (PR_GetEnvSecure("NSS_STRICT_SHUTDOWN")) { |
139 pkixLog = PR_NewLogModule("pkix"); | 139 pkixLog = PR_NewLogModule("pkix"); |
140 } | 140 } |
141 /* | 141 /* |
142 * Register Object, it is the base object of all other objects. | 142 * Register Object, it is the base object of all other objects. |
143 */ | 143 */ |
144 pkix_pl_Object_RegisterSelf(plContext); | 144 pkix_pl_Object_RegisterSelf(plContext); |
145 | 145 |
146 /* | 146 /* |
147 * Register Error and String, since they will be needed if | 147 * Register Error and String, since they will be needed if |
148 * there is a problem in registering any other type. | 148 * there is a problem in registering any other type. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 /* The library was not initilized */ | 255 /* The library was not initilized */ |
256 PKIX_RETURN(OBJECT); | 256 PKIX_RETURN(OBJECT); |
257 } | 257 } |
258 | 258 |
259 PR_DestroyLock(classTableLock); | 259 PR_DestroyLock(classTableLock); |
260 | 260 |
261 pkix_pl_HttpCertStore_Shutdown(plContext); | 261 pkix_pl_HttpCertStore_Shutdown(plContext); |
262 | 262 |
263 #ifdef DEBUG | 263 #ifdef DEBUG |
264 numLeakedObjects = pkix_pl_lifecycle_ObjectLeakCheck(NULL); | 264 numLeakedObjects = pkix_pl_lifecycle_ObjectLeakCheck(NULL); |
265 if (PR_GetEnv("NSS_STRICT_SHUTDOWN")) { | 265 if (PR_GetEnvSecure("NSS_STRICT_SHUTDOWN")) { |
266 PORT_Assert(numLeakedObjects == 0); | 266 PORT_Assert(numLeakedObjects == 0); |
267 } | 267 } |
268 #else | 268 #else |
269 pkix_pl_lifecycle_ObjectLeakCheck(NULL); | 269 pkix_pl_lifecycle_ObjectLeakCheck(NULL); |
270 #endif | 270 #endif |
271 | 271 |
272 if (plContext != NULL) { | 272 if (plContext != NULL) { |
273 PKIX_PL_NssContext_Destroy(plContext); | 273 PKIX_PL_NssContext_Destroy(plContext); |
274 } | 274 } |
275 | 275 |
276 pkix_pl_initialized = PKIX_FALSE; | 276 pkix_pl_initialized = PKIX_FALSE; |
277 | 277 |
278 PKIX_RETURN(OBJECT); | 278 PKIX_RETURN(OBJECT); |
279 } | 279 } |
OLD | NEW |