mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 19:05:28 +00:00
Fix a crash during initialization of interfaces (bxc#8447)
GInterfaceInfo.Data was automatically set to be a GCHandle on the interface adapter. But the generated GInterfaceInitHandlers were not using it, just free'ing it. But for the GInterface property support, the Data field is now used to pass the class pointer, so casting it to a GCHandle to free it would cause an exception. We now don't assume anything about GInterfaceInfo.Data.
This commit is contained in:
parent
05fb2e2f3a
commit
306f422c38
|
@ -114,8 +114,6 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("\t\t\tnative_iface." + vm.Name + " = iface." + vm.Name + ";");
|
||||
}
|
||||
sw.WriteLine ("\t\t\tMarshal.StructureToPtr (native_iface, ifaceptr, false);");
|
||||
sw.WriteLine ("\t\t\tGCHandle gch = (GCHandle) data;");
|
||||
sw.WriteLine ("\t\t\tgch.Free ();");
|
||||
}
|
||||
|
||||
foreach (Property prop in Properties.Values) {
|
||||
|
|
|
@ -55,12 +55,7 @@ namespace GLib {
|
|||
public abstract IntPtr Handle { get; }
|
||||
|
||||
internal GInterfaceInfo Info {
|
||||
get {
|
||||
if (info.Data == IntPtr.Zero)
|
||||
info.Data = (IntPtr) GCHandle.Alloc (this);
|
||||
|
||||
return info;
|
||||
}
|
||||
get { return info; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue