From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7047 invoked by alias); 12 May 2003 01:05:10 -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 6982 invoked from network); 12 May 2003 01:05:09 -0000 Received: from unknown (HELO snoopy.pacific.net.au) (61.8.0.36) by sources.redhat.com with SMTP; 12 May 2003 01:05:09 -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.3) with ESMTP id h4C155Pc028736; Mon, 12 May 2003 11:05:05 +1000 Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h4C154Qg008379; Mon, 12 May 2003 11:05:04 +1000 (EST) Received: from localhost (ppp82.dyn228.pacific.net.au [203.143.228.82]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h4C151YZ025438; Mon, 12 May 2003 11:05:02 +1000 (EST) Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19F1kM-0004ZM-00; Mon, 12 May 2003 11:04:54 +1000 To: Marko Rauhamaa Cc: guile-gtk@sources.redhat.com Subject: Re: Fixed memory leaks in gdk-1.2.defs References: From: Kevin Ryde Mail-Copies-To: never Date: Mon, 12 May 2003 01:05:00 -0000 In-Reply-To: (Marko Rauhamaa's message of "08 May 2003 23:25:08 -0700") Message-ID: <8765oh3rgq.fsf@zip.com.au> User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2003-q2/txt/msg00050.txt.bz2 --=-=-= Content-length: 970 Marko Rauhamaa writes: > > - build-guile-gtk-1.2, guile-gtk.c: GDK and GTK differ in the reference > count policy. While GTK returns the widgets with a reference count 0, > GDK returns them with a reference count 1. That means that > gdk-1.2.defs should not increment the reference count -- but it was > doing that. I don't know if it's this change or something else, but I seem to now be losing references to GdkFont. The program below prints something like for me (i386 debian with current cvs guile), # id 2400002 id 2400002 id 2400002 id 0 id 0 id 0 ... It seems the font is freed, despite having an "f" variable referring to it. I put a printf in boxed_free and saw it getting released at the point "id" changes. Dunno where the fault lies though. The symptom in my program was a gdk-draw-string failing on account of a bad font type (it was looking at freed memory I think). --=-=-= Content-Disposition: attachment; filename=foo.scm Content-length: 349 (use-modules (ice-9 format) (gtk gdk) (gtk gtk)) (define f (gdk-font-intern "fixed")) (format #t "~a\n" f) (format #t "id ~x\n" (gdk-font-id f)) (define wid (gtk-window-new 'toplevel)) (gtk-idle-add (lambda () (let ((id (gdk-font-id f))) (format #t "id ~x\n" id) (gc)))) (gtk-widget-show-all wid) (gtk-standalone-main wid) --=-=-=--