8000 Fixed PythonException leak · losttech/pythonnet@338dcc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 338dcc1

Browse files
amos402Martin-Molinero
authored andcommitted
Fixed PythonException leak
1 parent 9aa9b1a commit 338dcc1

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/runtime/finalizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private void AddPendingCollect()
105105

106106
private int OnPendingCollect(IntPtr arg)
107107
{
108-
Collect();
108+
DisposeAll();
109109
_pending = false;
110110
return 0;
111111
}

src/runtime/pythonexception.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ public PythonException()
2121
{
2222
IntPtr gs = PythonEngine.AcquireLock();
2323
Runtime.PyErr_Fetch(ref _pyType, ref _pyValue, ref _pyTB);
24-
Runtime.XIncref(_pyType);
25-
Runtime.XIncref(_pyValue);
26-
Runtime.XIncref(_pyTB);
2724
if (_pyType != IntPtr.Zero && _pyValue != IntPtr.Zero)
2825
{
2926
string type;

0 commit comments

Comments
 (0)
0