java-gobject-introspection r157 - trunk/src/gobject/runtime



Author: walters
Date: Sun Jan  4 01:32:50 2009
New Revision: 157
URL: http://svn.gnome.org/viewvc/java-gobject-introspection?rev=157&view=rev

Log:
Add dummy TypeMapper ctor, map null correctly for GBoxed

The TypeMapper ctor is just to avoid special casing in CodeFactory
a different case from struct/union.

Need to handle null for obvious reasons.

Modified:
   trunk/src/gobject/runtime/GBoxed.java

Modified: trunk/src/gobject/runtime/GBoxed.java
==============================================================================
--- trunk/src/gobject/runtime/GBoxed.java	(original)
+++ trunk/src/gobject/runtime/GBoxed.java	Sun Jan  4 01:32:50 2009
@@ -20,6 +20,12 @@
 	public GBoxed() {
 	}
 	
+	/* This one matches the TypeMapper ctors on Struct/Union, otherwise the
+	 * same as the no-arg ctor. */
+	public GBoxed(TypeMapper mapper) {
+		this();
+	}
+	
 	public GBoxed(GType gtype, Pointer ptr) {
 		super(ptr);
 		this.gtype = gtype;
@@ -97,6 +103,8 @@
 	
 	// Called from the compiler
 	public static RegisteredType boxedFor(Pointer ptr, Class<?> klass) {
+		if (ptr == null)
+			return null;
 		return boxedFor(ptr, klass, GType.fromClass(klass));
 	}
 	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]