Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8dee53

Browse files
committed
Document refcount increase
1 parent d9b21a5 commit c8dee53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/runtime/importhook.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ internal static void Shutdown()
124124

125125
internal static void SaveRuntimeData(RuntimeDataStorage storage)
126126
{
127+
// Increment the reference counts here so that the objects don't
128+
// get freed in Shutdown.
127129
Runtime.XIncref(py_clr_module);
128130
Runtime.XIncref(root.pyHandle);
129131
storage.AddValue("py_clr_module", py_clr_module);

0 commit comments

Comments
 (0)