Version française
Home     About     Download     Resources     Contact us    
Browse thread
simulate class destructor
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stefano Zacchiroli <zack@b...>
Subject: Re: [Caml-list] simulate class destructor
On Sat, Jun 25, 2005 at 07:52:07PM +1000, Pietro Abate wrote:
> Is it possible to simulate class destructor, that is convince Gc to call
> a method before deallocating the object ? I'd like to take a closer look
> at what's happening in my program to check if everything works at it
> should... I've a NodeCounter module with a counter that increase every
> time I create a new object, now I'd like to decrement the counter when
> the object is de-allocated. Impossible ?

Gc.finalise

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-