8000 take care of stragglers · pythonnet/pythonnet@46a85fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 46a85fe

Browse files
committed
take care of stragglers
1 parent bd7e745 commit 46a85fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/converter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ internal static IntPtr ToPython(object value, Type type)
207207
// pyHandle as is, do not convert.
208208
if (value is ModuleObject modobj)
209209
{
210-
return modobj.pyHandle;
210+
var handle = modobj.pyHandle;
211+
Runtime.XIncref(handle);
212+
return handle;
211213
}
212214

213215
// hmm - from Python, we almost never care what the declared

0 commit comments

Comments
 (0)
0