diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-08-15 00:56:43 -0400 |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-08-15 00:56:43 -0400 |
commit | ae30a1d0287bf0d3049c3a32b00944acedb2e428 (patch) | |
tree | fdad7c8bf1cdfe72ff951922dee0577943ca60d3 /Python/random.c | |
parent | da8504a96e55e1a653f2511ac6f01078323fa608 (diff) | |
parent | 16855cc83fd8e3ad0be9fd242546f1e87c2d02d7 (diff) | |
download | cpython-ae30a1d0287bf0d3049c3a32b00944acedb2e428.tar.gz |
Null merge.
Diffstat (limited to 'Python/random.c')
-rw-r--r-- | Python/random.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Python/random.c b/Python/random.c index 2941ba16af..a052b65725 100644 --- a/Python/random.c +++ b/Python/random.c @@ -15,8 +15,6 @@ static int _Py_HashSecret_Initialized = 0; #endif #ifdef MS_WINDOWS -/* This handle is never explicitly released. Instead, the operating - system will release it when the process terminates. */ static HCRYPTPROV hCryptProv = 0; static int @@ -298,7 +296,12 @@ _PyRandom_Init(void) void _PyRandom_Fini(void) { -#ifndef MS_WINDOWS +#ifdef MS_WINDOWS + if (hCryptProv) { + CryptReleaseContext(hCryptProv, 0); + hCryptProv = 0; + } +#else dev_urandom_close(); #endif } |