Merge pull request #89 from knocte/master

glib: fix IntPtr.Zero being dereferenced in GLib.Value.ToBoxed()
This commit is contained in:
Bertrand Lorentz 2013-11-09 08:08:40 -08:00
commit 859832f6e4

View File

@ -414,6 +414,10 @@ namespace GLib {
object ToBoxed ()
{
IntPtr boxed_ptr = g_value_get_boxed (ref this);
if (boxed_ptr == IntPtr.Zero)
return null;
Type t = GType.LookupType (type);
if (t == null)
throw new Exception ("Unknown type " + new GType (type).ToString ());