public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
To: Marko Rauhamaa <marko@pacujo.net>
Cc: guile-gtk@sources.redhat.com
Subject: Re: Fixed memory leaks in gdk-1.2.defs
Date: Mon, 12 May 2003 01:05:00 -0000	[thread overview]
Message-ID: <8765oh3rgq.fsf@zip.com.au> (raw)
In-Reply-To: <m34r44prgb.fsf@lumo.pacujo.net> (Marko Rauhamaa's message of "08 May 2003 23:25:08 -0700")

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

Marko Rauhamaa <marko@pacujo.net> 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),

    #<GdkFont 8058b28>
    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).


[-- Attachment #2: foo.scm --]
[-- Type: text/plain, Size: 349 bytes --]

(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)

  reply	other threads:[~2003-05-12  1:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-09  6:33 Marko Rauhamaa
2003-05-12  1:05 ` Kevin Ryde [this message]
2003-05-14  1:18   ` Marko Rauhamaa
2003-05-12  1:08 ` Kevin Ryde
2003-05-12  7:55   ` Marko Rauhamaa
2003-05-15 23:03     ` Kevin Ryde
2003-05-16  1:02       ` Marko Rauhamaa
2003-05-17  8:08         ` Marko Rauhamaa
2003-06-18 23:31 ` GdkEvent copy under signal handler (was: Fixed memory leaks in gdk-1.2.defs) Kevin Ryde

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=8765oh3rgq.fsf@zip.com.au \
    --to=user42@zip.com.au \
    --cc=guile-gtk@sources.redhat.com \
    --cc=marko@pacujo.net \
    /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).