Date: Thu, 06 Jul 2006 10:30:29 +0900 (JST) Message-Id: <20060706.103029.130179453.garrigue at math.nagoya-u.ac.jp> To: rich at annexia.org Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: GDraw.pixmap - do they get cleaned up by the garbage collector? From: Jacques Garrigue In-Reply-To: <20060705163208.GA20852 at furbychan.cocan.org> References: <20060705163208.GA20852 at furbychan.cocan.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: Text/Plain; charset=us-ascii Content-Length: 779 From: Richard Jones > If I create pixmap using GDraw.pixmap, and later that pixmap becomes > unreferenced, will the garbage collector clean up the object, and more > importantly, cause the X server to free up the pixmap? Yes, it will be collected eventually. Note however that it is rather hard to evaluate how much resources a pixmap consumes, so that this "eventually" may be rather late. (GC is guaranteed to occurs at least every 50 gobject allocations (done from caml), pixmaps being one of the many kinds of gobjects.) > If not, is there an explicit way to destroy a GDraw.pixmap and cause > the X server to free it? In case you think that deallocation is too slow, you can explicitly destroy a pixmap with (Gdk.Pixmap.destroy pm#pixmap). Jacques