resource-disposal

How to force a Java thread to close a thread-local database connection

When Using a thread-local database connection, closure of the connection is required when the thread exists. This I can only do if I can override the run() method of the calling thread. Even that is not a great solution, since at time of exit, I don't know if a connection has ever been opened by that thread. The problem is in fact more...

C# How to track down a font disposal

I have a font which is being disposed of which is causing an exception and I can't find where the font is being disposed. I have a feeling it is being disposed of by print preview. Can someone recommend how to track this issue down? Thanks. ...