From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29905 invoked by alias); 14 May 2003 01:18:40 -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 29898 invoked from network); 14 May 2003 01:18:40 -0000 Received: from unknown (HELO lumo.pacujo.net) (209.77.185.85) by sources.redhat.com with SMTP; 14 May 2003 01:18:40 -0000 Received: (from marko@localhost) by lumo.pacujo.net (8.11.6/8.11.6/SuSE Linux 0.5) id h4E1AL708727; Tue, 13 May 2003 18:10:21 -0700 To: guile-gtk@sources.redhat.com Subject: Re: Fixed memory leaks in gdk-1.2.defs References: <8765oh3rgq.fsf@zip.com.au> From: Marko Rauhamaa Date: Wed, 14 May 2003 01:18:00 -0000 In-Reply-To: <8765oh3rgq.fsf@zip.com.au> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q2/txt/msg00068.txt.bz2 Kevin Ryde : > 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. Yeah, I was confused about the copying semantics. I have now submitted a fix. BTW, the copying rules are as follows: You MUST COPY the return value of a C function if the C function returns * a fresh object with reference count 0, * one of its arguments as is, * a field of one of its arguments as is or * a global object as is. You MUST NOT COPY the return value of a C function if the C function * returns a fresh object with a reference count 1, * returns one of its arguments after incrementing the reference count, * returns a field of one of its arguments after incrementing reference count or * dequeues an object and hands it over to the caller. Marko -- Marko Rauhamaa mailto:marko@pacujo.net http://pacujo.net/marko/