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

Commit247e2d9

Browse files
committed
Fix ref count error
1 parentcee8e17 commit247e2d9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎src/embed_tests/TestPyInt.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void TestCtorSByte()
8686
publicvoidTestCtorPtr()
8787
{
8888
vari=newPyInt(5);
89+
Runtime.Runtime.XIncref(i.Handle);
8990
vara=newPyInt(i.Handle);
9091
Assert.AreEqual(5,a.ToInt32());
9192
}
@@ -94,6 +95,7 @@ public void TestCtorPtr()
9495
publicvoidTestCtorPyObject()
9596
{
9697
vari=newPyInt(5);
98+
Runtime.Runtime.XIncref(i.Handle);
9799
vara=newPyInt(i);
98100
Assert.AreEqual(5,a.ToInt32());
99101
}

‎src/embed_tests/TestPyLong.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public void TestCtorDouble()
102102
publicvoidTestCtorPtr()
103103
{
104104
vari=newPyLong(5);
105+
Runtime.Runtime.XIncref(i.Handle);
105106
vara=newPyLong(i.Handle);
106107
Assert.AreEqual(5,a.ToInt32());
107108
}
@@ -110,6 +111,7 @@ public void TestCtorPtr()
110111
publicvoidTestCtorPyObject()
111112
{
112113
vari=newPyLong(5);
114+
Runtime.Runtime.XIncref(i.Handle);
113115
vara=newPyLong(i);
114116
Assert.AreEqual(5,a.ToInt32());
115117
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp