Skip to content

Commit 461f94d

Browse files
committed
Updated C++# to fix a memory and an ambiguity error, among others.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent f10b2be commit 461f94d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Diff for: QtSharp.Tests/Manual/QtCore/Kernel/QObjectTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void TestParentChildConstructor()
4545
[Test]
4646
public void TestNativeConstructor()
4747
{
48-
var o = new QObject(_qObject.__Instance);
48+
var o = QObject.__CreateInstance(_qObject.__Instance);
4949

5050
Assert.AreEqual(_qObject.__Instance, o.__Instance);
5151
}

Diff for: QtSharp.Tests/Manual/QtCore/Tools/QStringRefTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void TestStringConstructor()
5959
[Test]
6060
public void TestIntPtrConstructor()
6161
{
62-
var s = new QStringRef(_qString.__Instance);
62+
var s = QStringRef.__CreateInstance(_qString.__Instance);
6363

6464
Assert.AreEqual(_testString, s.ToString());
6565
}

Diff for: QtSharp/QList.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ public override void CSharpMarshalToManaged(MarshalContext ctx)
157157
if ((type.Type.TryGetClass(out @class) ||
158158
(type.Type.IsPointerTo(out pointee) && pointee.TryGetClass(out @class))) && @class.IsAbstract)
159159
{
160-
supportBefore.WriteLine("__list.Add(new {0}Internal(new global::System.IntPtr(__qlistData.At(i))));", type, ctx.ReturnVarName);
160+
supportBefore.WriteLine("__list.Add({0}Internal.{1}(new global::System.IntPtr(__qlistData.At(i))));", type, Helpers.CreateInstanceIdentifier);
161161
}
162162
else
163163
{
164-
supportBefore.WriteLine("__list.Add(new {0}(new global::System.IntPtr(__qlistData.At(i))));", type, ctx.ReturnVarName);
164+
supportBefore.WriteLine("__list.Add({0}.{1}(new global::System.IntPtr(__qlistData.At(i))));", type, Helpers.CreateInstanceIdentifier);
165165
}
166166
}
167167
supportBefore.WriteCloseBraceIndent();

0 commit comments

Comments
 (0)