P
Peter Hemmingsen
Hi,
I have written a dotnet class that in its constructor consumes a license
from a central license pool. In the destructor it free the license again.
But since I don't know when the destructor is called (that is up to the
garbage collector) the object (and hence the application) consume a license
although it is not in use any more.
I could of course write a specific "logoff" method to run the specific part
of the destructor code that frees the license, but then I have to deal with
an object that is "de-initialized" and therefore not usable.
Is there any other place to implement destructor code that are always called
immediately when the object is deleted?
Peter
I have written a dotnet class that in its constructor consumes a license
from a central license pool. In the destructor it free the license again.
But since I don't know when the destructor is called (that is up to the
garbage collector) the object (and hence the application) consume a license
although it is not in use any more.
I could of course write a specific "logoff" method to run the specific part
of the destructor code that frees the license, but then I have to deal with
an object that is "de-initialized" and therefore not usable.
Is there any other place to implement destructor code that are always called
immediately when the object is deleted?
Peter