Date: Wed, 5 Jul 2006 17:32:09 +0100 To: lablgtk at math.nagoya-u.ac.jp Subject: GDraw.pixmap - do they get cleaned up by the garbage collector? Message-ID: <20060705163208.GA20852 at furbychan.cocan.org> Mime-Version: 1.0 Content-Disposition: inline From: Richard Jones Content-Type: text/plain; charset=us-ascii Content-Length: 1127 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? If not, is there an explicit way to destroy a GDraw.pixmap and cause the X server to free it? This is the code: let backing = GDraw.pixmap ~width ~height ~window () in let backing = ref backing in let configure window backing ev = prerr_endline "configure"; let width = GdkEvent.Configure.width ev in let height = GdkEvent.Configure.height ev in let pixmap = GDraw.pixmap ~width ~height ~window () in backing := pixmap; (* <--- previous pixmap becomes unreferenced here *) true in ignore (drawing_area#event#connect#configure ~callback:(configure window backing)); I've been trying to answer this question by looking at the source for lablgtk2 - so far I'm no nearer to understanding what is going on :-( Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com