2004-11-04 Todd Berman <tberman@off.net>
* doc/en/GLib/ListBase.xml: Add documentation for ListBase.Empty * glib/ListBase.cs: Add ListBase.Empty, frees the children and the list. * glib/Markup.cs: Fix Alex's tomboy crash, sending -1 instead of Length. * gtk/FileChooserDialog.custom: * gtk/FileChooserWidget.custom: properly free the list. svn path=/trunk/gtk-sharp/; revision=35650
This commit is contained in:
parent
131f2ed0d9
commit
cac3c4a368
6 changed files with 43 additions and 2 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-11-04 Todd Berman <tberman@off.net>
|
||||||
|
|
||||||
|
* doc/en/GLib/ListBase.xml: Add documentation for ListBase.Empty
|
||||||
|
* glib/ListBase.cs: Add ListBase.Empty, frees the children and the
|
||||||
|
list.
|
||||||
|
* glib/Markup.cs: Fix Alex's tomboy crash, sending -1 instead of
|
||||||
|
Length.
|
||||||
|
* gtk/FileChooserDialog.custom:
|
||||||
|
* gtk/FileChooserWidget.custom: properly free the list.
|
||||||
|
|
||||||
2004-11-03 Todd Berman <tberman@off.net>
|
2004-11-03 Todd Berman <tberman@off.net>
|
||||||
|
|
||||||
* gtk/FileChooserDialog.custom:
|
* gtk/FileChooserDialog.custom:
|
||||||
|
|
|
@ -259,5 +259,17 @@
|
||||||
<remarks />
|
<remarks />
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
|
<Member MemberName="Empty">
|
||||||
|
<MemberSignature Language="C#" Value="public void Empty ();" />
|
||||||
|
<MemberType>Method</MemberType>
|
||||||
|
<ReturnValue>
|
||||||
|
<ReturnType>System.Void</ReturnType>
|
||||||
|
</ReturnValue>
|
||||||
|
<Parameters />
|
||||||
|
<Docs>
|
||||||
|
<summary>Empties the list.</summary>
|
||||||
|
<remarks>Empties, and frees the list, as well as all of its children</remarks>
|
||||||
|
</Docs>
|
||||||
|
</Member>
|
||||||
</Members>
|
</Members>
|
||||||
</Type>
|
</Type>
|
||||||
|
|
|
@ -153,6 +153,23 @@ namespace GLib {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DllImport ("libglib-2.0-0.dll")]
|
||||||
|
static extern void g_free (IntPtr item);
|
||||||
|
|
||||||
|
[DllImport ("libglib-2.0-0.dll")]
|
||||||
|
static extern void g_object_unref (IntPtr item);
|
||||||
|
|
||||||
|
public void Empty ()
|
||||||
|
{
|
||||||
|
for (uint i = 0; i < Count; i++)
|
||||||
|
{
|
||||||
|
if (element_type == typeof (GLib.Object))
|
||||||
|
g_object_unref (NthData (i));
|
||||||
|
else
|
||||||
|
g_free (NthData (i));
|
||||||
|
}
|
||||||
|
Dispose ();
|
||||||
|
}
|
||||||
|
|
||||||
private class ListEnumerator : IEnumerator
|
private class ListEnumerator : IEnumerator
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace GLib {
|
||||||
if (s == null)
|
if (s == null)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
return Marshaller.PtrToStringGFree (g_markup_escape_text (s, s.Length));
|
return Marshaller.PtrToStringGFree (g_markup_escape_text (s, -1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
string[] result = new string [list.Count];
|
string[] result = new string [list.Count];
|
||||||
for (int i = 0; i < list.Count; i++)
|
for (int i = 0; i < list.Count; i++)
|
||||||
result [i] = (string) list [i];
|
result [i] = (string) list [i];
|
||||||
|
list.Empty ();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ public string[] Filenames {
|
||||||
string[] result = new string [list.Count];
|
string[] result = new string [list.Count];
|
||||||
for (int i = 0; i < list.Count; i++)
|
for (int i = 0; i < list.Count; i++)
|
||||||
result [i] = (string) list [i];
|
result [i] = (string) list [i];
|
||||||
|
list.Empty ();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue