public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* gdk-list-visuals leak
@ 2003-08-28  0:39 Kevin Ryde
  0 siblings, 0 replies; only message in thread
From: Kevin Ryde @ 2003-08-28  0:39 UTC (permalink / raw)
  To: guile-gtk

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

        * gdk-1.2.defs, gdk-support.c, guile-gtk.h (gdk_list_visuals): Use an
        _interp to free the returned list.


[-- Attachment #2: gdk-1.2.defs.list-visuals.diff --]
[-- Type: text/plain, Size: 348 bytes --]

--- gdk-1.2.defs.~1.52.~	1970-01-01 10:00:01.000000000 +1000
+++ gdk-1.2.defs	2003-08-28 10:29:35.000000000 +1000
@@ -1915,8 +1915,8 @@
   SCM					; list of GdkVisualType
   ())
 
-(define-func gdk_list_visuals
-  ((list GdkVisual))
+(define-func gdk_list_visuals_interp
+  SCM ;; list of GdkVisual
   ())
 
 (define-func gdk_visual_get_best_depth

[-- Attachment #3: gdk-support.c.list-visuals.diff --]
[-- Type: text/plain, Size: 812 bytes --]

--- gdk-support.c.~1.40.~	1970-01-01 10:00:01.000000000 +1000
+++ gdk-support.c	2003-08-28 10:37:04.000000000 +1000
@@ -1422,6 +1422,26 @@
   return list;
 }
 
+static SCM
+_sgdk_helper_toscm_copy_GdkVisual (void *mem)
+{
+  return sgtk_boxed2scm (* (GdkVisual**) mem, &sgtk_gdk_visual_info, 1);
+}
+
+/* The list returned by gdk_list_visuals be freed by the caller.
+   Could do this sort of thing with a .defs file option, but easy enough to
+   have explicit code while there's only a few such.  */
+SCM
+gdk_list_visuals_interp (void)
+{
+  GList* visuals;
+  SCM ret;
+  visuals = gdk_list_visuals ();
+  ret = sgtk_list2scm (visuals, _sgdk_helper_toscm_copy_GdkVisual);
+  g_list_free (visuals);
+  return ret;
+}
+
 GList*
 gdk_drag_context_targets (GdkDragContext* context)
 { return context->targets; }

[-- Attachment #4: guile-gtk.h.list-visuals.diff --]
[-- Type: text/plain, Size: 562 bytes --]

--- guile-gtk.h.~1.39.~	1970-01-01 10:00:01.000000000 +1000
+++ guile-gtk.h	2003-08-28 10:33:55.000000000 +1000
@@ -77,6 +77,11 @@
   char **args_short_names;
 } sgtk_object_info;
 
+
+/* gdk-glue.c */
+extern sgtk_boxed_info sgtk_gdk_visual_info;
+
+
 void sgtk_register_type_infos (sgtk_type_info **infos);
 sgtk_type_info *sgtk_get_type_info (guint type_seqno);
 
@@ -415,6 +420,7 @@
 
 SCM gdk_query_depths_interp (void);
 SCM gdk_query_visual_types_interp (void);
+SCM gdk_list_visuals_interp (void);
 
 GList* gdk_drag_context_targets (GdkDragContext*);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-28  0:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-28  0:39 gdk-list-visuals leak Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).