Author: mkestner
Date: 2005-03-09 12:01:35 -0500 (Wed, 09 Mar 2005)
New Revision: 41607

Modified:
   trunk/gtk-sharp/ChangeLog
   trunk/gtk-sharp/glib/Marshaller.cs
Log:

2005-03-09  Mike Kestner  <[EMAIL PROTECTED]>

        * glib/Marshaller.cs : add IntPtr.Zero guarding.


Modified: trunk/gtk-sharp/ChangeLog
===================================================================
--- trunk/gtk-sharp/ChangeLog   2005-03-09 16:56:36 UTC (rev 41606)
+++ trunk/gtk-sharp/ChangeLog   2005-03-09 17:01:35 UTC (rev 41607)
@@ -1,3 +1,7 @@
+2005-03-09  Mike Kestner  <[EMAIL PROTECTED]>
+
+       * glib/Marshaller.cs : add IntPtr.Zero guarding.
+
 2005-03-09  Alexandre Gomes  <[EMAIL PROTECTED]>
 
        * gtk/Gtk.metadata: Set GetVisibleRect param to be passed as out.

Modified: trunk/gtk-sharp/glib/Marshaller.cs
===================================================================
--- trunk/gtk-sharp/glib/Marshaller.cs  2005-03-09 16:56:36 UTC (rev 41606)
+++ trunk/gtk-sharp/glib/Marshaller.cs  2005-03-09 17:01:35 UTC (rev 41607)
@@ -42,6 +42,9 @@
 
                public static string Utf8PtrToString (IntPtr ptr) 
                {
+                       if (ptr == IntPtr.Zero)
+                               return null;
+
                        int len = (int) g_utf8_strlen (ptr, -1);
                        byte[] bytes = new byte [len];
                        Marshal.Copy (ptr, bytes, 0, len);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to