Skip to content

Commit 2b6bf9b

Browse files
author
dse
committed
Incref/Decref bugfix.
1 parent 9770c92 commit 2b6bf9b

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/embed_tests/TestPyAnsiString.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public void TestCtorPtr()
6363
const string expected = "foo";
6464

6565
var t = new PyAnsiString(expected);
66+
Runtime.Runtime.XIncref(t.Handle);
6667
var actual = new PyAnsiString(t.Handle);
6768

6869
Assert.AreEqual(expected, actual.ToString());

src/embed_tests/TestPyLong.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public void TestCtorDouble()
102102
public void TestCtorPtr()
103103
{
104104
var i = new PyLong(5);
105+
Runtime.Runtime.XIncref(i.Handle);
105106
var a = new PyLong(i.Handle);
106107
Assert.AreEqual(5, a.ToInt32());
107108
}

src/embed_tests/TestPyString.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public void TestCtorPtr()
6464
const string expected = "foo";
6565

6666
var t = new PyString(expected);
67+
Runtime.Runtime.XIncref(t.Handle);
6768
var actual = new PyString(t.Handle);
6869

6970
Assert.AreEqual(expected, actual.ToString());

0 commit comments

Comments
 (0)