8000 Fix memory leak add pyobject finalizer by Martin-Molinero · Pull Request #27 · QuantConnect/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Fix memory leak add pyobject finalizer #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix ref count error
  • Loading branch information
amos402 authored and Martin-Molinero committed Mar 27, 2019
commit 8eb35914efad5607a8701887bf92e49c47644a1e
1 change: 1 addition & 0 deletions src/embed_tests/TestPyAnsiString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void TestCtorPtr()
const string expected = "foo";

var t = new PyAnsiString(expected);
Runtime.Runtime.XIncref(t.Handle);
var actual = new PyAnsiString(t.Handle);

Assert.AreEqual(expected, actual.ToString());
Expand Down
1 change: 1 addition & 0 deletions src/embed_tests/TestPyFloat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void Dispose()
public void IntPtrCtor()
{
var i = new PyFloat(1);
Runtime.Runtime.XIncref(i.Handle);
var ii = new PyFloat(i.Handle);
Assert.AreEqual(i.Handle, ii.Handle);
}
Expand Down
1 change: 1 addition & 0 deletions src/embed_tests/TestPyString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void TestCtorPtr()
const string expected = "foo";

var t = new PyString(expected);
Runtime.Runtime.XIncref(t.Handle);
var actual = new PyString(t.Handle);

Assert.AreEqual(expected, actual.ToString());
Expand Down
0