mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-17 03:44:53 +02:00
2005-03-03 Mike Kestner <mkestner@novell.com>
* generator/ClassBase.cs : use "as" instead of a cast in FromNative. * generator/Method.cs : remove the if/else checks for Object retvals. * glib/Object.cs : return null immediately for NULL in GetObject. svn path=/trunk/gtk-sharp/; revision=41409
This commit is contained in:
parent
eec84f4b5d
commit
0677e5ac75
@ -1,3 +1,9 @@
|
|||||||
|
2005-03-03 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* generator/ClassBase.cs : use "as" instead of a cast in FromNative.
|
||||||
|
* generator/Method.cs : remove the if/else checks for Object retvals.
|
||||||
|
* glib/Object.cs : return null immediately for NULL in GetObject.
|
||||||
|
|
||||||
2005-03-03 Mike Kestner <mkestner@novell.com>
|
2005-03-03 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* generator/ClassBase.cs : add null checking to CallByName. No sense
|
* generator/ClassBase.cs : add null checking to CallByName. No sense
|
||||||
|
@ -164,7 +164,7 @@ namespace GtkSharp.Generation {
|
|||||||
|
|
||||||
public override string FromNative(string var)
|
public override string FromNative(string var)
|
||||||
{
|
{
|
||||||
return "(" + QualifiedName + ") GLib.Object.GetObject(" + var + ")";
|
return "GLib.Object.GetObject(" + var + ") as " + QualifiedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void GenProperties (GenerationInfo gen_info)
|
protected void GenProperties (GenerationInfo gen_info)
|
||||||
|
@ -327,7 +327,7 @@ namespace GtkSharp.Generation {
|
|||||||
sw.Write(indent + "\t\t\t");
|
sw.Write(indent + "\t\t\t");
|
||||||
if (retval.MarshalType == "void") {
|
if (retval.MarshalType == "void") {
|
||||||
sw.WriteLine(CName + call + ";");
|
sw.WriteLine(CName + call + ";");
|
||||||
} else if (ret_igen is ObjectGen || ret_igen is OpaqueGen) {
|
} else if (ret_igen is OpaqueGen) {
|
||||||
sw.WriteLine(retval.MarshalType + " raw_ret = " + CName + call + ";");
|
sw.WriteLine(retval.MarshalType + " raw_ret = " + CName + call + ";");
|
||||||
sw.WriteLine(indent +"\t\t\t" + retval.CSType + " ret;");
|
sw.WriteLine(indent +"\t\t\t" + retval.CSType + " ret;");
|
||||||
sw.WriteLine(indent + "\t\t\tif (raw_ret == IntPtr.Zero)");
|
sw.WriteLine(indent + "\t\t\tif (raw_ret == IntPtr.Zero)");
|
||||||
|
@ -91,6 +91,9 @@ namespace GLib {
|
|||||||
|
|
||||||
public static Object GetObject(IntPtr o, bool owned_ref)
|
public static Object GetObject(IntPtr o, bool owned_ref)
|
||||||
{
|
{
|
||||||
|
if (o == IntPtr.Zero)
|
||||||
|
return null;
|
||||||
|
|
||||||
Object obj;
|
Object obj;
|
||||||
WeakReference weak_ref = Objects[o] as WeakReference;
|
WeakReference weak_ref = Objects[o] as WeakReference;
|
||||||
if (weak_ref != null && weak_ref.IsAlive) {
|
if (weak_ref != null && weak_ref.IsAlive) {
|
||||||
|
Loading…
Reference in New Issue
Block a user