2004-01-28 John Luke <jluke@cfl.rr.com>
* glade/XML.custom : some null checking for crash prevention. [Fixes #47017] svn path=/trunk/gtk-sharp/; revision=22585
This commit is contained in:
parent
0b41ef6a58
commit
9a6216e07e
2 changed files with 22 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-01-28 John Luke <jluke@cfl.rr.com>
|
||||
|
||||
* glade/XML.custom : some null checking for crash prevention.
|
||||
[Fixes #47017]
|
||||
|
||||
2004-01-28 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* gtk/gtk-api.xml : regen
|
||||
|
|
|
@ -30,7 +30,17 @@
|
|||
/// </remarks>
|
||||
public string Filename {
|
||||
get {
|
||||
string ret = Marshal.PtrToStringAnsi (gtksharp_glade_xml_get_filename (Handle));
|
||||
string ret;
|
||||
IntPtr ptr = gtksharp_glade_xml_get_filename (Handle);
|
||||
if (ptr == IntPtr.Zero)
|
||||
{
|
||||
// from resource
|
||||
ret = System.Reflection.Assembly.GetCallingAssembly ().Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = Marshal.PtrToStringAnsi (ptr);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +57,12 @@
|
|||
static extern IntPtr glade_get_widget_name (IntPtr widget);
|
||||
|
||||
static public string GetWidgetName (Gtk.Widget w) {
|
||||
string ret = Marshal.PtrToStringAnsi (glade_get_widget_name (w.Handle));
|
||||
string ret;
|
||||
IntPtr ptr = glade_get_widget_name (w.Handle);
|
||||
if (ptr == IntPtr.Zero)
|
||||
ret = "";
|
||||
else
|
||||
ret = Marshal.PtrToStringAnsi (ptr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue