mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-07 07:23:18 +02:00
generator: Set Owned to false when ownership of a parameter changes
This fixes an issue where unref would get called too often because the ownership has changed when passing an instance to the native side. See https://github.com/mono/gtk-sharp/pull/112 for more details.
This commit is contained in:
parent
961b9ef348
commit
8e0de299e4
@ -290,6 +290,8 @@ namespace GtkSharp.Generation {
|
|||||||
return new string [] { gen.MarshalType + " native_" + CallName + ";" };
|
return new string [] { gen.MarshalType + " native_" + CallName + ";" };
|
||||||
} else if (PassAs == "ref" && CSType != MarshalType) {
|
} else if (PassAs == "ref" && CSType != MarshalType) {
|
||||||
return new string [] { gen.MarshalType + " native_" + CallName + " = (" + gen.MarshalType + ") " + CallName + ";" };
|
return new string [] { gen.MarshalType + " native_" + CallName + " = (" + gen.MarshalType + ") " + CallName + ";" };
|
||||||
|
} else if (gen is OpaqueGen && Owned) {
|
||||||
|
return new string [] { CallName + ".Owned = false;" };
|
||||||
}
|
}
|
||||||
|
|
||||||
return new string [0];
|
return new string [0];
|
||||||
|
Loading…
Reference in New Issue
Block a user