FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ensure interned strings can not be referenced after InternString.Shut… · pythonnet/pythonnet@d0d7616 · GitHub

Commit d0d7616

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

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎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)

Back | FazBrowse Home | New Git URL