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

+3-2
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)