If you go into the java-specification you will notice that there is no guarantee that 
the finalize() method will actually be called by the gc. If you want to make sure 
finalize is executed put it in a different method and call it from a finally block. 

SOemthing like this

void myfinalizer()
{
        // code goes here
}


// this is the actually closing code
try
{
        // some code that exits the program/session
}
finally
{
        myfinalizer();
}

Hope that helps

STefan

Reply via email to