summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/nss/nss/lib/nss/nssinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/nss/nss/lib/nss/nssinit.c')
-rw-r--r--chromium/third_party/nss/nss/lib/nss/nssinit.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/chromium/third_party/nss/nss/lib/nss/nssinit.c b/chromium/third_party/nss/nss/lib/nss/nssinit.c
index 83e50d2c45b..208e71dd3cd 100644
--- a/chromium/third_party/nss/nss/lib/nss/nssinit.c
+++ b/chromium/third_party/nss/nss/lib/nss/nssinit.c
@@ -1099,14 +1099,6 @@ nss_Shutdown(void)
shutdownRV = SECFailure;
}
pk11sdr_Shutdown();
- /*
- * A thread's error stack is automatically destroyed when the thread
- * terminates, except for the primordial thread, whose error stack is
- * destroyed by PR_Cleanup. Since NSS is usually shut down by the
- * primordial thread and many NSS-based apps don't call PR_Cleanup,
- * we destroy the calling thread's error stack here.
- */
- nss_DestroyErrorStack();
nssArena_Shutdown();
if (status == PR_FAILURE) {
if (NSS_GetError() == NSS_ERROR_BUSY) {
@@ -1114,6 +1106,16 @@ nss_Shutdown(void)
}
shutdownRV = SECFailure;
}
+ /*
+ * A thread's error stack is automatically destroyed when the thread
+ * terminates, except for the primordial thread, whose error stack is
+ * destroyed by PR_Cleanup. Since NSS is usually shut down by the
+ * primordial thread and many NSS-based apps don't call PR_Cleanup,
+ * we destroy the calling thread's error stack here. This must be
+ * done after any NSS_GetError call, otherwise NSS_GetError will
+ * create the error stack again.
+ */
+ nss_DestroyErrorStack();
nssIsInitted = PR_FALSE;
temp = nssInitContextList;
nssInitContextList = NULL;