Skip to content

Commit d0d7616

Browse files
committed
ensure interned strings can not be referenced after InternString.Shutdown
1 parent 707ef36 commit d0d7616

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/runtime/intern.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ public static void Initialize()
4242

4343
public static void Shutdown()
4444
{
45-
foreach (var ptr in _intern2strings.Keys)
45+
foreach (var entry in _intern2strings)
4646
{
47-
Runtime.XDecref(ptr);
47+
Runtime.XDecref(entry.Key);
48+
typeof(PyIdentifier).GetField(entry.Value).SetValue(null, IntPtr.Zero);
4849
}
4950
_string2interns = null;
5051
_intern2strings = null;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy