public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
To: guile-gtk@sources.redhat.com
Subject: gdk-list-visuals leak
Date: Thu, 28 Aug 2003 00:39:00 -0000	[thread overview]
Message-ID: <87wucylioz.fsf@zip.com.au> (raw)

[-- 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*);
 

                 reply	other threads:[~2003-08-28  0:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wucylioz.fsf@zip.com.au \
    --to=user42@zip.com.au \
    --cc=guile-gtk@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).