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
1 changed files with 2 additions and 0 deletions
|
@ -290,6 +290,8 @@ namespace GtkSharp.Generation {
|
|||
return new string [] { gen.MarshalType + " native_" + CallName + ";" };
|
||||
} else if (PassAs == "ref" && CSType != MarshalType) {
|
||||
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];
|
||||
|
|
Loading…
Reference in a new issue