Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab6b69a

Browse files
committed
ClassDerivedObject: python values converted to .NET must not be disposed
1 parentb9e0f14 commitab6b69a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

‎src/runtime/classderived.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ public static T InvokeMethod<T>(IPythonDerivedType obj, string methodName, strin
671671
}
672672

673673
PyObjectpy_result=method.Invoke(pyargs);
674-
disposeList.Add(py_result);
675674
return(T)py_result.AsManagedObject(typeof(T));
676675
}
677676
}
@@ -774,12 +773,10 @@ public static T InvokeGetProperty<T>(IPythonDerivedType obj, string propertyName
774773
try
775774
{
776775
Runtime.XIncref(self.pyHandle);
777-
using(varpyself=newPyObject(self.pyHandle))
778-
using(PyObjectpyvalue=pyself.GetAttr(propertyName))
779-
{
776+
usingvarpyself=newPyObject(self.pyHandle);
777+
PyObjectpyvalue=pyself.GetAttr(propertyName);
780778
return(T)pyvalue.AsManagedObject(typeof(T));
781779
}
782-
}
783780
finally
784781
{
785782
Runtime.PyGILState_Release(gs);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp