mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
Fix generator to use MiniObject.OwnedHandle for parameters with owned="true"
This commit is contained in:
parent
b3b018c916
commit
896ddae3c5
3 changed files with 15 additions and 1 deletions
|
@ -312,6 +312,11 @@ namespace GtkSharp.Generation {
|
|||
sw.Close ();
|
||||
}
|
||||
|
||||
public string CallByName (string name, bool owned)
|
||||
{
|
||||
return name + " == null ? IntPtr.Zero : " + name + (owned ? ".OwnedHandle" : ".Handle");
|
||||
}
|
||||
|
||||
public override string FromNative (string var, bool owned)
|
||||
{
|
||||
return "Gst.MiniObject.GetObject(" + var + (owned ? ", true" : "") + ") as " + QualifiedName;
|
||||
|
|
|
@ -411,6 +411,11 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("}");
|
||||
sw.Close ();
|
||||
}
|
||||
|
||||
public string CallByName (string name, bool owned)
|
||||
{
|
||||
return name + " == null ? IntPtr.Zero : " + name + (owned ? ".OwnedHandle" : ".Handle");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -262,8 +262,12 @@ namespace GtkSharp.Generation {
|
|||
call_parm += CallName;
|
||||
} else if (gen is IManualMarshaler)
|
||||
call_parm = "native_" + CallName;
|
||||
else if (gen is MiniObjectGen)
|
||||
call_parm = ((MiniObjectGen) gen).CallByName(CallName, Owned);
|
||||
else if (gen is ObjectGen)
|
||||
call_parm = ((ObjectGen) gen).CallByName(CallName, Owned);
|
||||
else
|
||||
call_parm = SymbolTable.Table.CallByName(CType, CallName);
|
||||
call_parm = gen.CallByName(CallName);
|
||||
|
||||
return call_parm;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue