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 * The following handles the loading, unloading and management of | 5 * The following handles the loading, unloading and management of |
6 * various PCKS #11 modules | 6 * various PCKS #11 modules |
7 */ | 7 */ |
8 #define FORCE_PR_LOG 1 | 8 #define FORCE_PR_LOG 1 |
9 #include "seccomon.h" | 9 #include "seccomon.h" |
10 #include "pkcs11.h" | 10 #include "pkcs11.h" |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 | 615 |
616 /* do we want the semantics to allow unloading the internal library? | 616 /* do we want the semantics to allow unloading the internal library? |
617 * if not, we should change this to SECFailure and move it above the | 617 * if not, we should change this to SECFailure and move it above the |
618 * mod->loaded = PR_FALSE; */ | 618 * mod->loaded = PR_FALSE; */ |
619 if (mod->internal && (mod->dllName == NULL)) { | 619 if (mod->internal && (mod->dllName == NULL)) { |
620 #ifndef NSS_STATIC | 620 #ifndef NSS_STATIC |
621 if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) { | 621 if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) { |
622 if (softokenLib) { | 622 if (softokenLib) { |
623 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); | 623 disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); |
624 if (!disableUnload) { | 624 if (!disableUnload) { |
| 625 #ifdef DEBUG |
625 PRStatus status = PR_UnloadLibrary(softokenLib); | 626 PRStatus status = PR_UnloadLibrary(softokenLib); |
626 PORT_Assert(PR_SUCCESS == status); | 627 PORT_Assert(PR_SUCCESS == status); |
| 628 #else |
| 629 PR_UnloadLibrary(softokenLib); |
| 630 #endif |
627 } | 631 } |
628 softokenLib = NULL; | 632 softokenLib = NULL; |
629 } | 633 } |
630 loadSoftokenOnce = pristineCallOnce; | 634 loadSoftokenOnce = pristineCallOnce; |
631 } | 635 } |
632 #endif | 636 #endif |
633 return SECSuccess; | 637 return SECSuccess; |
634 } | 638 } |
635 | 639 |
636 library = (PRLibrary *)mod->library; | 640 library = (PRLibrary *)mod->library; |
(...skipping 16 matching lines...) Expand all Loading... |
653 | 657 |
654 void | 658 void |
655 nss_DumpModuleLog(void) | 659 nss_DumpModuleLog(void) |
656 { | 660 { |
657 #ifdef DEBUG_MODULE | 661 #ifdef DEBUG_MODULE |
658 if (modToDBG) { | 662 if (modToDBG) { |
659 print_final_statistics(); | 663 print_final_statistics(); |
660 } | 664 } |
661 #endif | 665 #endif |
662 } | 666 } |
OLD | NEW |