From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18006 invoked by alias); 28 Aug 2003 00:39:19 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 17997 invoked from network); 28 Aug 2003 00:39:16 -0000 Received: from unknown (HELO snoopy.pacific.net.au) (61.8.0.36) by sources.redhat.com with SMTP; 28 Aug 2003 00:39:16 -0000 Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.4) with ESMTP id h7S0d60J016923 for ; Thu, 28 Aug 2003 10:39:12 +1000 Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h7S0d6kv003915 for ; Thu, 28 Aug 2003 10:39:06 +1000 (EST) Received: from localhost (ppp99.dyn228.pacific.net.au [203.143.228.99]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h7S0d4vj020741 for ; Thu, 28 Aug 2003 10:39:05 +1000 (EST) Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19sAoP-0001AL-00; Thu, 28 Aug 2003 10:38:53 +1000 To: guile-gtk@sources.redhat.com Subject: gdk-list-visuals leak From: Kevin Ryde Mail-Copies-To: never Date: Thu, 28 Aug 2003 00:39:00 -0000 Message-ID: <87wucylioz.fsf@zip.com.au> User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2003-q3/txt/msg00058.txt.bz2 --=-=-= Content-length: 122 * gdk-1.2.defs, gdk-support.c, guile-gtk.h (gdk_list_visuals): Use an _interp to free the returned list. --=-=-= Content-Disposition: attachment; filename=gdk-1.2.defs.list-visuals.diff Content-length: 348 --- 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 --=-=-= Content-Disposition: attachment; filename=gdk-support.c.list-visuals.diff Content-length: 812 --- 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; } --=-=-= Content-Disposition: attachment; filename=guile-gtk.h.list-visuals.diff Content-length: 562 --- 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*); --=-=-=--