[Monodevelop-patches-list] r1201 - in trunk/MonoDevelop: . gdldock/gdl
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sat Mar 20 00:57:02 EST 2004
Author: ggiraldez
Date: 2004-03-20 00:57:02 -0500 (Sat, 20 Mar 2004)
New Revision: 1201
Modified:
trunk/MonoDevelop/ChangeLog
trunk/MonoDevelop/gdldock/gdl/DockLayout.custom
trunk/MonoDevelop/gdldock/gdl/Makefile.am
Log:
2004-03-20 Gustavo Gir?\195?\161ldez <gustavo.giraldez at gmx.net>
* gdldock/gdl/Makefile.am: Make the generated source files depend
on the custom files too.
* gdldock/gdl/DockLayout.custom: Fix list elements leak.
Modified: trunk/MonoDevelop/ChangeLog
===================================================================
--- trunk/MonoDevelop/ChangeLog 2004-03-20 05:17:14 UTC (rev 1200)
+++ trunk/MonoDevelop/ChangeLog 2004-03-20 05:57:02 UTC (rev 1201)
@@ -1,5 +1,11 @@
2004-03-20 Gustavo Giráldez <gustavo.giraldez at gmx.net>
+ * gdldock/gdl/Makefile.am: Make the generated source files depend
+ on the custom files too.
+ * gdldock/gdl/DockLayout.custom: Fix list elements leak.
+
+2004-03-20 Gustavo Giráldez <gustavo.giraldez at gmx.net>
+
* gdldock/gdl/Makefile.am:
* gdldock/gdl/Gdl.metadata:
* gdldock/gdl/DockLayout.custom: Provide a customized GetLayouts
Modified: trunk/MonoDevelop/gdldock/gdl/DockLayout.custom
===================================================================
--- trunk/MonoDevelop/gdldock/gdl/DockLayout.custom 2004-03-20 05:17:14 UTC (rev 1200)
+++ trunk/MonoDevelop/gdldock/gdl/DockLayout.custom 2004-03-20 05:57:02 UTC (rev 1201)
@@ -5,14 +5,20 @@
[DllImport("gdldock")]
static extern IntPtr gdl_dock_layout_get_layouts(IntPtr raw, bool include_default);
-public string[] GetLayouts(bool include_default) {
- IntPtr list_ptr = gdl_dock_layout_get_layouts(Handle, include_default);
- GLib.List list = new GLib.List (list_ptr, typeof (string));
+[DllImport("libglib-2.0-0.dll")]
+static extern void g_free (IntPtr mem);
- // FIXME: list elements are leaked
+
+public string[] GetLayouts (bool include_default) {
+ IntPtr list_ptr = gdl_dock_layout_get_layouts (Handle, include_default);
+ GLib.List list = new GLib.List (list_ptr, typeof (int));
+
string[] result = new string [list.Count];
- for (int i = 0; i < list.Count; i++)
- result [i] = list [i] as string;
+ int i = 0;
+ foreach (int ptr in list) {
+ result [i++] = Marshal.PtrToStringAnsi ((IntPtr) ptr);
+ g_free ((IntPtr) ptr);
+ }
return result;
}
Modified: trunk/MonoDevelop/gdldock/gdl/Makefile.am
===================================================================
--- trunk/MonoDevelop/gdldock/gdl/Makefile.am 2004-03-20 05:17:14 UTC (rev 1200)
+++ trunk/MonoDevelop/gdldock/gdl/Makefile.am 2004-03-20 05:57:02 UTC (rev 1201)
@@ -7,6 +7,9 @@
@gtksharp_prefix@/share/gapi/gtk-api.xml \
@gtksharp_prefix@/share/gapi/atk-api.xml
+CUSTOM_FILES = DockItemFlags.cs DockParamFlags.cs DockLayout.custom
+custom_files_build = $(addprefix $(srcdir)/, $(CUSTOM_FILES))
+
all: $(ASSEMBLY)
gdl-api.xml: $(srcdir)/gdl-api.raw $(srcdir)/Gdl.metadata
@@ -14,7 +17,7 @@
chmod u+w gdl-api.xml
gapi-fixup --api=gdl-api.xml --metadata=$(srcdir)/Gdl.metadata
-generated-stamp: gdl-api.xml
+generated-stamp: gdl-api.xml $(custom_files_build)
gapi-codegen --generate gdl-api.xml --include $(INCLUDE_APIS) --outdir=generated --customdir=$(srcdir) --assembly-name=gdl-sharp && touch generated-stamp
$(ASSEMBLY): generated-stamp ../../build/bin
@@ -36,5 +39,5 @@
CLEANFILES=$(ASSEMBLY) generated-stamp generated/* gdl-api.xml
-EXTRA_DIST = gdl-api.raw Gdl.metadata DockItemFlags.cs DockParamFlags.cs DockLayout.custom
+EXTRA_DIST = gdl-api.raw Gdl.metadata $(CUSTOM_FILES)
More information about the Monodevelop-patches-list
mailing list