Skip to content

Commit e231735

Browse files
committed
Fixed a crash when creating an object while handling a Qt meta-call.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent d509ac6 commit e231735

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.7.3 - 19.9.2017
2+
Fixed:
3+
- Crash when creating an object while handling a Qt meta-call.
4+
15
0.7.2 - 18.9.2017
26
Added:
37
- Bindings for the constructors of QImage and QPixmap taking arrays;

QtSharp/QObject.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ private object GetParameterValue(Handler handler, int i, System.Reflection.Param
7272
case TypeCode.Empty:
7373
return null;
7474
case TypeCode.Object:
75-
return Activator.CreateInstance(type, arg);
75+
var constructor = type.GetMethod("__CreateInstance",
76+
global::System.Reflection.BindingFlags.NonPublic |
77+
global::System.Reflection.BindingFlags.Static |
78+
global::System.Reflection.BindingFlags.FlattenHierarchy,
79+
null, new[] { typeof(IntPtr), typeof(bool) }, null);
80+
return constructor.Invoke(null, new object[] { arg, false });
7681
case TypeCode.DBNull:
7782
return DBNull.Value;
7883
case TypeCode.Boolean:

0 commit comments

Comments
 (0)